Thread View: alt.lang.basic
2 messages
2 total messages
Started by Tyler
Fri, 16 Jul 1999 00:00
Enter To Stop A Program?
Author: Tyler
Date: Fri, 16 Jul 1999 00:00
Date: Fri, 16 Jul 1999 00:00
9 lines
1229 bytes
1229 bytes
How do you use enter to stop a q-basic program? Also, how do you use those
"Keyboard Scan Codes"? Like if I wanted to end a program with the Ctrl key
how would I do that? Thanks in advance.
------------------
Tyler
**************
tkrampe@usa.net
------------------
Re: Enter To Stop A Program?
Author: Marc van den Dikkenberg
Date: Fri, 16 Jul 1999 00:00
Date: Fri, 16 Jul 1999 00:00
34 lines
2424 bytes
2424 bytes
On Fri, 16 Jul 1999 10:55:10 -0400, "Tyler" <tkrampe@usa.net> wrote: >How do you use enter to stop a q-basic program? Also, how do you use those >"Keyboard Scan Codes"? Like if I wanted to end a program with the Ctrl key >how would I do that? Thanks in advance. You can stop a QBasic program with END or SYSTEM And to end a program by pressing CONTROL, take a look at the following: (Just remove the lines for the conditions you do not want to check for) WHILE INKEY$ <> "q" DEF SEG = 0 plop% = PEEK(&H417) plop2% = PEEK(&H418) IF (plop% AND 2) THEN PRINT "LEFT SHIFT PRESSED" IF (plop% AND 1) THEN PRINT "RIGHT SHIFT PRESSED" IF (plop% AND 4) THEN PRINT "CONTROL PRESSED" IF (plop% AND 8) THEN PRINT "ALT PRESSED" IF (plop2% AND 16) THEN PRINT "SCROLL LOCK PRESSED" IF (plop2% AND 128) THEN PRINT "INSERT PRESSED" IF (plop2% AND 32) THEN PRINT "NUMLOCK PRESSED" IF (plop2% AND 64) THEN PRINT "CAPS LOCK PRESSED" WEND There are a few things you can check as well, like telling the Left & Right CTRL/ALT apart, and whether or not CAPSLOCK, NUMLOCK, SCROLLLOCK and INSERT are turned on... -- Marc van den Dikkenberg -- The PowerBasic Archives (EU) -- http://www.xs4all.nl/~excel/pb.html The PowerBasic Archives (US) -- http://www.basicguru.com/dikkenberg All Basic Code Archives -- http://come.to/abcpackets
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads