Bugs (my program, not yours)
Hello all -
Euphoria at times can be very confusing.
I have written a program and am now trying to make it run. Here are some
segments from the program:
clear_screen
kb = open("CON","r")
puts(1,"Do you want hard copy? - y/n\n")
hcopy = getc(kb)
[snip]
puts(1,"Specify output... ")
outspec = getc(kb)
[snip]
puts(1,"Number to be analyzed\n")
puts(1,"Enter 0 to end program\n")
x = gets(kb)
if x = 0 then
abort(0)
end if
[snip]
Yesterday (Tuesday) I kept getting error messages, "Euphoria expects 'this',
not 'that' with a line number. In that line I found something that looked
irregular, and changed it to 'this'. Then I tried to run the program again,
and I found an error message in the same line, "What is 'this'?" That is,
Euphoria said it 'expected' something; I gave it what it 'expected' and it
didn't know what to do with it. Euphoria found an 'error' in several
different kinds of 'this'.
I got around that somehow -- I don't know what I did, but the program
stopped generating such error messages.
Today (Wednesday) it's hanging up on 'gets'. The sequence entered from the
keyboard ends when I press the 'return' key. If I enter two numeric digits,
which should be a two-element sequence, and press the 'return' key, the
program hangs up again. (The program should be able to handle any input up
to a billion or so, the top of Euphoria's normal range.) 'ex.err' says the
sequence has three elements, the third one being an extra 'line feed'
character (ASCII 10). This happens repeatedly, even when I press the
'return' key *very* gently, to prevent its possible 'bouncing'.
The manual says x should be declared as an object, so that x can be either
an atom or a sequence. I had x defined as an atom; I changed it to an
object. That made the program hang up on the very next statement, 'if x = 0
then abort(0)'. Euphoria says x must be an atom.
Like Hamlet, Euphoria apparently can't make up its mind.
What's going on here?
Wally Riley
wryly at mindspring.com
|
Not Categorized, Please Help
|
|