Msg: 779 *Conference*

11-03-91 09:47:21

From: RICHARD HANSON

To : ROBERT BENSON

Subj: REPLY TO MSG #777 (BASIC TOKENS)

Gosh!  You're right!!  Out of 256 possible characters only the ? functions as a
programming short-cut in BASIC.  Key in a ? and it lists out as PRINT.
Amazing?  But if that's it, then that's it.  There are, of course, ways to use
the ? short-cut to maximum advantage.
 
 ? = PRINT
 L? = LPRINT
 ?@130,"One moment please..." = PRINT@130,"One moment please..."
 ?:?:?:? = PRINT:PRINT:PRINT:PRINT
 
In my quest for other tokens I wrote a simple loop program to create a
BASIC-ready input file.  The program uses x from 0 to 255 to both insert line
numbers and the printed ASCII characters associated with the calue of x for
each line.
 
 10 OPEN"token"FOROUTPUTAS1
 20 FORX=0TO255
 30 PRINT#1,XCHR$(X)
 40 NEXTX
 50 MENU
 
The resulting file started out as...
 
 0 
 1 ^A
 2 ^B
 3 ^C
 ...etc through line 255 with its character
 
Then, I went into BASIC and did a LOAD"TOKEN <enter>, to load the TOKEN.DO
file, figuring that as each character came into BASIC it would either abort the
process, not do anything, or reveal itself as a token by displaying a BASIC
command.
 
I got a ton of aborts... ?UL Error.  ?UL Error means undefined line error.
BASIC didn't like the character presented after the line number.  In each case
I went back to the menu and deleted the offending line from the TOKEN.DO file,
then back into BASIC to LOAD"TOKEN again.
 
Alas, only ASCII character value number 63, the ?, presented itself as a token
for the BASIC command PRINT.
 
You are right, Robert, there is only one character token available as a BASIC
programming short-cut, the ? used for the BASIC command PRINT.
 
Thanks for your help... -Rick-
 
PS: The way I found the ?UL Error line that caused the load abort was to simply
use the LIST command to list down to the last line that made it.  The next line
would be the point of abort.  It was a simple matter to find that line in the
.DO file via the <F1> Find function, then <F7> Select and <F6> Cut.