1. Euphoria ctrl-c bug?
- Posted by Jason Gade <jaygade at yahoo.com> Feb 10, 2006
- 448 views
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.
2. Re: Euphoria ctrl-c bug?
- Posted by Jason Gade <jaygade at yahoo.com> Feb 10, 2006
- 444 views
if machine_func(M_CHECK_BREAK, 0) then exit end if
^^^^ Really, that exit statement was there when I ran the code! Plus, I just retested it for sure. -- "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.