Euphoria ctrl-c bug?

new topic     » topic index » view thread      » older message » newer message

Okay, so I was playing with get_key to help out Funkbrat.

I tried the following code on windows xp:
constant M_CHECK_BREAK = 43 -- from file.e

integer key, ix

ix = 'A'
key = get_key()

while key != 27 do -- esc
    key = get_key()
    if key != -1 then
        if key > 32 and key < 127 then
            ix = key
        end if
    end if
    puts(1, ix)
    
    if machine_func(M_CHECK_BREAK, 0) then end if
    
end while


What happens is that when I press ctrl-c, the program quickly prints "Press
Enter..." on the screen, but the screen continues to fill up with the last
character that I pressed. When I press a new character, it doesn't change like it
should. It maybe prints it once or twice and then keeps printing the last
character before ctrl-c. (It took me awhile to realize that I could just press
enter to make it stop).

Is it because the last key stays in the buffer and the program continues to read
it? Why doesn't the program stop executing if I pressed ctrl-c? Even though it
seems to keep executing, it never picks up on the escape key, either, which
should be the exit condition for the loop.

I only added the check_break() to see why the program wasn't accepting ctrl-c.
It doesn't seem to work either. Unless I was supposed to add allow_break(0).

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu