comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » using GET_KBRD
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
using GET_KBRD [message #8305] Wed, 26 February 1997 00:00 Go to next message
Walid is currently offline  Walid
Messages: 9
Registered: July 1996
Junior Member
Hello All,

I have what should be a simple problem. The following 3-line program:

REPEAT BEGIN
A = GET_KBRD(0)
PRINT, BYTE(A)
ENDREP UNTIL A EQ 'q'

exits when the user types 'q'. However, remove the print statement,
and the program runs indefinitely regardless of any user input!

Anyone know what's wrong. I'm running IDL 4.0.1 on a PC.
Also, to get around this problem in a large program that I wanted the
option to exit from (ctrl-c doesn't usually work from a PC), I went
ahead and used the print,a--but it took several passes in the program's
loop before the keyboard buffer was read. I also tried to flush,0 the
keyboard buffer to no avail.

Thanks in advance,

Walid
Re: using GET_KBRD [message #8363 is a reply to message #8305] Mon, 03 March 1997 00:00 Go to previous message
pit is currently offline  pit
Messages: 92
Registered: January 1996
Member
In article <33150043.7B48@wam.umd.edu>,
Walid Atia <atia@wam.umd.edu> writes:
> Hello All,
>
> I have what should be a simple problem. The following 3-line program:
>
> REPEAT BEGIN
> A = GET_KBRD(0)
> PRINT, BYTE(A)
> ENDREP UNTIL A EQ 'q'
>
> exits when the user types 'q'. However, remove the print statement,
> and the program runs indefinitely regardless of any user input!
>
> Anyone know what's wrong. I'm running IDL 4.0.1 on a PC.

Works here (also PC, Linux), but with some delay, i.e. you have to press
the "q" for a while until something happens. Not very nice, indeed.

Maybe change the GET_KBRD to GET_KBRD(1), then it waits until a key is
pressed, or insert a short wait, then it also works as expected.

Peter

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
Peter "Pit" Suetterlin http://www.uni-sw.gwdg.de/~pit
Universitaets-Sternwarte Goettingen
Tel.: +49 551 39-5048 pit@uni-sw.gwdg.de
-- * -- * ...-- * -- * ...-- * -- * ...-- * -- * ...-- * -- * ...-- * --
Come and see the stars! http://www.kis.uni-freiburg.de/~ps/SFB
Sternfreunde Breisgau e.V. Tel.: +49 7641 3492
____________________________________________________________ ______________
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Gradient of two dimensional field
Next Topic: Re: The intersection of 2 arrays

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:39:17 PDT 2025

Total time taken to generate the page: 0.00542 seconds