The Variable Lister below is useful in keeping track of the variables you are using while writing a program. Antic came across this Variable Lister by Mark Brown in "Current Notes," the magazine of the National Capitol Atari Users Group.
Type in Variable Lister and LIST it to disk or cassette under an appropriate name. Type NEW and either ENTER or LOAD a BASIC program, or even type one in. When done, ENTER the program below from disk or cassette, and type in GOTO 32666 at the READY prompt. The program will automatically type out the names of all variables in your original program, and give you a count of them. Atari BASIC limits you to 128 variables in a program. A useful modification to this program would be to re-direct the output to a printer.
32666 ? CHR$(125):POKE 203,PEEK(130):POKE
204,PEEK(131):POKE 205,0:IF PEEK(PEEK(203)+256*
PEEK(204))=0 THEN 32761
32667 IF PEEK(PEEK(203)+256*PEEK(204))<128
THEN ? CHR$(PEEK(PEEK(203)+256*PEEK(204)));:
32668 ? CHR$(PEEK(PEEK(203)+256*PEEK(204))-128):
32669 POKE 203,((PEEK(2o3)+1)-256*(PEEK(203)=
255)):IF PEEK(203)=0 THEN POKE 204,PEEK(204)+1
32670 IF PEEK(PEEK(203)+256*PEEK(204))<>0 THEN 32667
32671 ? :? PEEK(205);" variables in use"
Richard Wood of Miami, Florida sent in the following modification to Artmaker~ from the July, 1986 Antic. It allows you to select different filenames for your creations. Change line number 35 to 39 and add these lines:
34 DIM FN$(14):GRAPHICS 0:? "ARTMAKER"
35 ? "SELECT FILENAME TO SAVE SCREEN TO":FN$=
"D:":? "D:";:CLOSE #1:OPEN #1,4,0,"K:"
36 GET #1,CHAR:IF CHAR=155 THEN 39
37 ? CHR$(CHAR);
38 FN$(LEN(FN$)+1)=CHR$(CHAR):GOTO 36
* Modify line # 90 to read:
90 CLOSE #1:OPEN #1,8,0,FN$
Wood also asks if anyone knows of a color screen dump that works with
the Epson JX-80.
Try the following as a simple protection scheme for your BASIC programs:
10 POKE 16,112:POKE 53774,112:REM DISABLE
20 POKE 580,1:REM FORCE RE-BOOT ON RESET
(YOUR PROGRAM HERE)
:FOR V1=V1 TO V2:POKE V1,155:NEXT V1
32767 V1=PEEK(138)+256*PEEK(139)+2:POKE V1,0:
The effect of these last two lines is to replace the variable table
with all carriage returns. SAVE an unprotected master copy of your program
on a separate disk before you RUN it. When you RUN it, the resultant file
can be RUN, but not LOADED or LISTed! Your ingenious BASIC code is now
protected from prying eyes, but your program can still be copied. Combine
this with the hardware key from the August, 1986 Antic and you will now
have a very well-protected program. A myriad of programming tricks like
this are described in Ian Chadwick's Mapping the Atari, from Compute! Books.
If you have a Tech Tip that you would like to share with other readers, send it along to Antic Tech Tips, 524 Second Street, San Francisco, CA 94107. You might get your name in print. We always welcome very short programs that demonstrate the Atari's powers, simple hardware modifications, or useful macros for popular software.