DW> My inclination would be to write the INKEY loop as
DW> something like:
DW> DO: k$ = UCASE$(INKEY$): LOOP UNTIL k$ >= "A" AND k$ <= "G"
DW> Then simply PRINT k$
DW> Wouldn't that be a whole lot simpler?!
Infinitely!
But menus don't usually use sequential characters.
You might have something like this:
[F] Format a disk
[C] Change directory
[D] Change drive
[L] List files
[Q] Quit to previous menu
Now you've got to check for specific characters and they
are not in sequence.
You might also do something like this:
WHILE INKEY$ > "": WEND
DO
K$ = UCASE$(INKEY$)
SELECT CASE K$
CASE "F", "C", "D", "L", "Q": EXIT DO
END SELECT
LOOP
This last method is actually much easier to read and
understand. Both its method and its purpose are immediately
clear at a glance.
---
> ] Those who don't learn from the past are... Rats! I forgot...
---
---------------
* Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750)
|