Qbasicnews.com
November 14, 2019, 04:47:30 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: input without return  (Read 2837 times)
johnfin
New Member

Posts: 4


« on: November 10, 2008, 11:01:52 AM »

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.
Logged
roy
Member
*
Posts: 33


« Reply #1 on: November 10, 2008, 01:52:28 PM »

INKEY$
Logged
Clippy
Member
*
Posts: 84



« Reply #2 on: November 10, 2008, 07:23:38 PM »

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
« Last Edit: November 10, 2008, 07:28:25 PM by Clippy » Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!