Waits for the user to press a key, and then returns a string containing the entered character.
string variable = GETCHAR$
Remarks and Examples
The GETCHAR$ function pauses the program and waits for the user to press a key. If the user has already entered a sequence of characters that have not yet been processed by the program, GETCHAR$ takes the next available character from the keyboard buffer and does not pause the program.
The entered character is returned in a string. The character is not displayed on the screen.
10 PRINT "Press any key." 20 X$ = GETCHAR$ 30 PRINT "Thank you. You pressed: "; X$ RUN
Press any key. Thank you. You pressed: J
Copyright 2006-2008, Kevin Matz, All Rights Reserved.