DOS QBASIC Keyboard Boolean

Want to just shoot the breeze? Forum 42 is the place!

Moderator: Moderators

Post Reply
Haunted360
Posts: 1000
Joined: Sat Jan 30, 2010 12:22 am
PSN Username: Haunted360
360 GamerTag: Haunted 360
Location: Australia
Contact:

DOS QBASIC Keyboard Boolean

Post by Haunted360 »

Hi. How do I in (Q)BASIC make a Boolean switch?

So if I press enter on the keyboard, it will do this event - when I press enter on the keyboard again, it will do this event.


Basically I want a stop and go button which is enter.



Thanks.
Haunted360
Posts: 1000
Joined: Sat Jan 30, 2010 12:22 am
PSN Username: Haunted360
360 GamerTag: Haunted 360
Location: Australia
Contact:

Re: DOS QBASIC Keyboard Boolean

Post by Haunted360 »

Never mind, I got it...

Code: Select all

DO
A$ = INKEY$
IF A$ = CHR$(13) THEN GOTO 5 ELSE GOTO 2
REM ... CODE TO BE ACTIVATED ...
LOOP UNTIL A$ = CHR$(13)
Not the best way to do it, but it works......


Was tested in QBASIC for DOS......
Post Reply