Einzelnen Beitrag anzeigen
Alt 12.10.2012, 01:43   #136
leecher
Moderator
GET_CH

E r g e b n i s / R e s u l t

Get a single character from the keyboard, without echo

B e s c h r e i b u n g / D e s c r i p t i o n

This procedure returns a character to the calling program. It does not
echo the character typed to the screen, so it is ideal for 'one key'
responses.

The developer can prompt the user to type 'Y or N' and this routine
will immediately return the key pressed. The user does not have to
type 'Y' followed by F10.

S y n t a x

Code:
string = call('GET_CH')
P a r a m e t e r

There are no parameters for this procedure

R e t u r n s

The procedure returns a string value.

Usually the string returned is the character typed by the user. However,
if the user presses <do:F10>, then the string returned is 'F10'.

Similarly, pressing <help:F1> returns F1 etc. Pressing <undo:Esc> returns
Esc.

B e i s p i e l / E x a m p l e

Code:
attach 'KEYBOARD'
put 'Please press Y or N to continue' , do newline 
a = call ('GET_CH')        ! get a single key press 
if a = 'Y'
   put 'You pressed Y'
else
   put 'You did not press y'
end if
detach 'KEYBOARD'
Q u e r v e r w e i s / C r o s s R e f e r e n c e
GET_CHE
FLUSHBUF
leecher ist offline   Mit Zitat antworten