Re: Euphoria ctrl-c bug? [Reposted]

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

Jason Gade wrote:
> 
> Jason Gade wrote:
> > 
> > Okay, so I was playing with get_key to help out Funkbrat.
> > 
> > I tried the following code on windows xp:
> > }}}
<eucode>
> > 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
> > </eucode>
{{{

> > 
> > 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).
> 
> Is this normal operation for the interpreter? The interpreter does not stop
> executing Euphoria code when ctrl-c is pressed but instead takes over the
> input
> buffer and continues to execute loops like this?
> 
> --
> "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.

Hmm... it closes properly when I press ctrl-c and when I press escape. It doesnt
say "Press Enter" at all. I've tested this on Windows XP SP2 with Euphoria 2.4
and 2.5: EXW.EXE and EX.EXE. Something very fishy is going.

What version of Euphoria are you using?


Regards,
Vincent

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

Search



Quick Links

User menu

Not signed in.

Misc Menu