RE: CURSOR procedure [message #1123 is a reply to message #1109] |
Tue, 03 August 1993 08:46  |
AMAZUK
Messages: 3 Registered: August 1993
|
Junior Member |
|
|
Hello,
Thanks to all who sent me ideas about the CURSOR procedure in IDL version
3.0.0 on VAX/VMS 5.5! I was having difficulties using repeated calls
to CURSOR in that it would work correctly the first time, but each call
after that would give erroneous results. I was basically trying to do:
for i = 0,4 do begin
cursor,x1,y1
xdata(i) = x1
ydata(i) = y1
endfor
The defaults for CURSOR procedure are /data and /wait in the version of IDL
that I am using. I had forgetten to mention before that I don't use a
mouse and that I select my x and y cursor positions by pressing <cr>. The
solution that I have found was given by Jim Pendelton and here is what he
said:
> Hi,
> Here's a guess based on years of screwing around with IDL cursor
> and keyboard input, and not on any great insight...It looks like your mouse
> is sending out more characters than are expected by IDL, for instance a
> three-character line control sequence (aka the GIN terminator) instead of a
> one-character. IDL takes as many as it wants, then gags on the rest, leaving
> some in the input stream for any subsequent calls to CURSOR.
>
> If you can't modify the GIN terminator with your terminal setup, I
> believe there's a way to do it with the DEVICE command.
>
> As a last resort, try a sequence such as
>
> cursor,x1,y1
> !err = 0 ; clears cursor input character storage
> dum=get_kbrd(0) ; clears keyboard input storage
> xdata(4) = x1
> ydata(4) = y1
>
> This MAY clear out the input buffer for you. It's worked for me in
> the past.
>
> Good luck!
>
> Jim Pendleton, Programmer Analyst/Technical Services Specialist
> GRO/OSSE, Dept. Physics & Astronomy
> Northwestern University
> j-pendleton@nwu.edu (708) 491-2748 (708) 491-3135 [FAX]
Ann
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
Ann Mazuk Internet: amazuk@dirac2.span.nasa.gov
The Aerospace Corporation SPAN: DIRAC2::AMAZUK
El Segundo, California
* same ole disclaimer: these views are mine - not my employer's or NASA's
------------------------------------------------------------ ----------------
|
|
|