Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Enter To Stop A Program?

1 view
Skip to first unread message

Tyler

unread,
Jul 16, 1999, 3:00:00 AM7/16/99
to
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
**************
tkr...@usa.net
------------------

Marc van den Dikkenberg

unread,
Jul 16, 1999, 3:00:00 AM7/16/99
to
On Fri, 16 Jul 1999 10:55:10 -0400, "Tyler" <tkr...@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


0 new messages