Re: Reading from the prompt [message #50117] |
Tue, 12 September 2006 10:01 |
Julio[1]
Messages: 52 Registered: May 2005
|
Member |
|
|
FÖLDY Lajos escreveu:
> On Tue, 12 Sep 2006, Julio wrote:
>
>> Hello... Here goes a simple question. I'm reading a string from the
>> prompt using:
>>
>> B = ''
>> ; Read input from the terminal:
>> READ, B, PROMPT='Yes (Y) or No (N)?: '
>>
>> I need to put Y or N and them press ENTER. Is there a way to read Y or
>> N without pressing ENTER?
>>
>> Cheers,
>> Júlio
>>
>
> print, 'Yes (Y) or No (N)?: ' & b=get_kbrd()
>
> but read the warning in the ref. guide.
>
> regards,
> lajos
>
Ok... get_kbrd helped. Thanks for all the comments.
Julio
|
|
|
Re: Reading from the prompt [message #50118 is a reply to message #50117] |
Tue, 12 September 2006 09:50  |
Foldy Lajos
Messages: 268 Registered: October 2001
|
Senior Member |
|
|
On Tue, 12 Sep 2006, Julio wrote:
> Hello... Here goes a simple question. I'm reading a string from the
> prompt using:
>
> B = ''
> ; Read input from the terminal:
> READ, B, PROMPT='Yes (Y) or No (N)?: '
>
> I need to put Y or N and them press ENTER. Is there a way to read Y or
> N without pressing ENTER?
>
> Cheers,
> Júlio
>
print, 'Yes (Y) or No (N)?: ' & b=get_kbrd()
but read the warning in the ref. guide.
regards,
lajos
|
|
|
Re: Reading from the prompt [message #50119 is a reply to message #50118] |
Tue, 12 September 2006 09:35  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Julio writes:
> Hello... Here goes a simple question. I'm reading a string from the
> prompt using:
>
> B = ''
> ; Read input from the terminal:
> READ, B, PROMPT='Yes (Y) or No (N)?: '
>
> I need to put Y or N and them press ENTER. Is there a way to read Y or
> N without pressing ENTER?
No. :-)
This is easily done with a widget, however. Have you
considered using a pop-up dialog?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|