home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
progbas
/
ascsu205.arj
/
ANYKEY.DOC
< prev
next >
Wrap
Text File
|
1991-11-23
|
3KB
|
79 lines
NOTES ON ANYKEY.COM
Version 1.00
Matt Roberts
3 Cedar St., # 8
Montpelier, Vt 05602-3006
08-07-91
───────────────────────────────────────────────────────────────────────────────
ANYKEY.COM was my first, rather weak, attempt at writing GETKEY.COM. When I
tried it out, I realized it just wasn't worth the time loss for such a small
return. For some reason, though, I didn't erase it after I wrote GETPAUSE.COM
(and later, GETKEY.COM).
I recently stumbled upon it, and thought it wasn't a bad example of the INKEY$
function. In fact, it solved a problem with that command which had been
plaguing me for some time.
ASIC 2.01 doesn't have the REPEAT...UNTIL and WHILE...WEND loop commands.
With other BASIC languages, both compilers and interpreters, I was trying to
use the INKEY$ function like this:
A$=INKEY$
WHILE A$=""
WEND
or like this:
A$=INKEY$
REPEAT
UNTIL A$<>""
Using these methods, pressing the desired key would not produce an immediate
result. In fact, I usually had to hold down the key until it repeated, which
generally played havoc with the results of the program I was trying to write.
Since I don't know much about computer architecture, I don't know why these
two loops didn't work, but they didn't. However, ASIC's approach to the same
loop, using an IF...THEN statement coupled with an implied GOTO (IF condition
THEN label), solved the problem completely. Use of the loop, as shown in
ANYKEY.ASI, will work with GW-BASIC, Locomotive BASIC 2, ApBASIC, and probably
all the other BASICs you're likely to run across. Pressing the key gets an
immediate result, and the resulting programs look a great deal more
professional.
If you have another BASIC, such as Microsoft's BASICA/GW-BASIC, you can see
for yourself the problems with the REPEAT...UNTIL and WHILE...WEND loops. You
can run ANYKEY.COM to see how it works if you wish, but there are no
surprises; it just works the way you'd expect.
You may have to do a little modifying of the code, of course, to adapt it to
other BASICs, for instance adding line numbers, and so forth.
TESTS
2
Version numbers exist for the purpose of testing this disk's utilities on
other computers. This version has been tested on the following:
Amstrad PC1512 SD: This system has an 8086 CPU, a composite monochrome
monitor, and CGA which can access 16 shades of gray (or color with a color
monitor) with a resolution of up to 640 X 200. The system originally came
with 512K RAM, which I've upgraded to 640K. It came with a single 5.25", 360K
drive. A second internal drive of the same type was later added, and I've
installed a 49Mb hard disk card. Operating system is MS-DOS 3.20. This line
has been discontinued. This utility had no problems running on the Amstrad.
Packard Bell Pack-Mate: This system has an 80286 CPU and a color VGA monitor.
Drives are one 40Mb internal hard disk, one 5.25", 1.2Mb drive, and one 3.5",
1.44 Mb drive. Operating system is MS-DOS 3.30. This utility had no problems
running on the Packard Bell.