Qbasicnews.com
input without return - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: QBasic (http://qbasicnews.com/newforum/forum-4.html)
+--- Forum: QB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-11.html)
+--- Thread: input without return (/thread-10180.html)



input without return - johnfin - 11-10-2008

How can I write an input statement for a selection menu in a program that does not require a return key input from the user.


Re: input without return - roy - 11-10-2008

INKEY$


Re: input without return - Clippy - 11-11-2008

Use an INKEY$ loop and assign the keypress to a string variable.
Code:
DO: K$ = UCASE$(INKEY$)  'use uppercase letters if alphabetical 'main loop

' menu code goes here...........

LOOP UNTIL K$ = CHR$(27)  'escape program loop

SYSTEM 'closes program

For numerical menues, just use the string number instead of letters.

Ted