Here is an article of immediate practical use if you have ever tried to type in long REM lines for machine code or wanted password protection for your programs. Also included are points on how to reduce SAVE/LOAD time, hidden program lines, PRINTing and COPYing lines 22 and 23, how to find the PRINT coordinates, and “custom” error codes.
Making Your REM Lines 10,000 Characters long…Instantly
If you have ever tried to use a REM line for machine code storage or for a data base (to save memory or to avoid slow printing – as mentioned later in this article), you know what a hassle it is to enter those long lines. Here is a much easier way:
1 REM 5▒RND▒▒▒▒▒▒
The keys after 1 REM are 5, graphic shifted P, the token RND, graphic shifted 1, three graphic 5’s, graphic 2, graphic shifted D.
Now decide how much space in bytes you want in your REM line, and enter this in the immediate mode:
LET A=spaces you want-9
POKE 16520,195
POKE 16519,INT(A/256)
POKE 16518,A-256*PEEK 16519
POKE 16512,INT((A+11)/256)
POKE 16511,A+11-256*PEEK 16512
RAND USR 16514
Now you have your 10,000 character REM line (or whatever). You can use the space from 16514 to 16513 + whatever your length was for the M.C. or database. Since you will be putting valuable information in this REM line, you may want to prevent accidental deletion by changing the line number to a zero with a POKE 16510, 0.
Password Protection
It’s fun to have passwords on your programs (so they’ll be “sophisticated”). Here’s a short password program protection routine:
1. POKE 16509,118
2. SAVE "program name"
3. PRINT "PASSWORD?"
4. INPUT I$
5. If I$<>"your password" THEN NEW
6. POKE 16509,0
7. REM rest of program
If someone decides to break the password protection by entering STOP at the INPUT, or by pressing BREAK, the computer will deny them use of the program (It will be as though it had disappeared).
Hidden Program Lines
If you want to remove lines from use (but not from memory), try POKE 16509,118. Any lines you’ve entered before this will not be noticed by the computer. They will reside between any program you enter later and the display file, and will not be used except by your POKE statements into that area.
Reducing SAVE/LOAD Time
I know how time consuming it is to LOAD or SAVE an array or display picture (an empty picture alone takes about 20 seconds). Here are some tips on reducing that time:
1. Get rid of unnecessary program lines. Use subroutines for repeated lines. Delete any REM lines you don’t need.
2. If you don’t need the variables you already have, CLEAR them. You will be able to do this with most programs (although you won’t be able to do this with the ones that don’t allow you to use RUN).
3. If you are using a 16k RAMPACK and do not need to keep the display picture, collapse it with POKE 16389,0. Again, you will be able to do this with most programs (exceptions are all programs, where you want to save your drawing). If the program uses a large array and is self-RUNning, you will want to add a POKE 16389,128 line and a CLS line after the SAVE line to avoid slow PRINTing.
PRINTing on the Bottom Two Lines
It sure would be nice to be able to PRINT on all the lines of the screen, wouldn’t it? Well, now you can! Use this in your programs:
(line number) POKE 16418,0 to turn on ability to PRINT on lines 22 and 23
There is a limitation however. Before using SCROLL or INPUT, you must turn the extra PRINTing ability off with
(line number) POKE 16418,2
You may then turn the extra PRINTing ability back on, but INPUT and SCROLL will have erased the bottom two lines, so it’s best to only use this technique in a part of the program where SCROLL and INPUT aren’t used.
COPYing the Whole Screen
After PRINTIng on lines 22 and 23, you may want to COPY the entire screen to your printer, which is useful for a long, continuous printed report or list. Use:
1 REM -/LN ?▒TAN
The keys after 1 REM are shifted J, shifted V, the token LN, shifted C, graphic shifted A, the token TAN.
In the immediate mode:
POKE 16517,107
Then any time you want to COPY the whole screen in your programs, use:
(line number) RAND USR 16514
Finding the PRINT coordinates
In some of your programs, such as matrix input or array listings, you will need to know the coordinates of the PRINT position to avoid an error stop. Here’s how to find them:
33-PEEK 16441 tells you the column number
24-PEEK 16442 tells you the line number
“Custom” Errors
In some programs, you may want to stop the program to alert the user to an error he has made. You can use any of the T/S 1000’s characters you want, such as E for “error”. At the desired stop point in the program:
(line number) POKE 16384, character code-1
Use only real character codes. You may use any letters, numbers, or graphics. The line number of the report code will be the POKE line number.
Have fun with these tips, and write me with any suggestions or ideas you may have.
Mather White
[address omitted]
Rome, PA 18837
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.