Many beginners do not understand REM statements and believe they are
responsible for program errors. They are in a way - if you don't bother
to read them! A REM statement actually has no effect at all on the
running of a program, it is there to help you understand what is going
on or to give you help in typing in the listing. If you wish you can
leave out all REM statements thus saving a lot of typing, but be
careful. Sometimes a program branches to a line containing a REM
statement and if you did not type that line you will get ERROR 12. The
solution is to change the line number of the GOTO or GOSUB so that it
refers to the line immediately following the line that you didn't type.
Leaving out REMs will save you some typing but it is very important that
you read all REMs before you type in a program. Quite often they give
you clues on how to type in the following lines and if you don't work it
out you will end up with all sorts of problems. Take TINY TEXT in Issue
2 for example. Line 580 gives you clues for typing the next few lines.
The funny little symbol that you can't find in your Manual is a
peculiarity of the printer. It cannot reproduce the right pointed arrow
which you get by pressing ESC,TAB and so line 580 gives you a clue by
saying that the symbol represents ESC,TAB. Try pressing ESC followed by
TAB to see the 'arrow' referred to. Remember, REM statements are there
to help you, not the program (they actually slow the program down). Make
sure you read them before typing any lines referred to.
Did you know that you can stop a listing from scrolling up the screen
by pressing CTRL and 1 at the same time? Pressing them again will start
the listing up again. Even the experts took a long time to find that
out!
The Atari has superb editing facilities but few people seem to use
them properly. Sit down a while and look through Chapter 3 of the
Reference Manual and play around with the screen. If you use editing
properly you will save a lot of time. Suppose for example you have to
type the following lines
10
IF A=6 THEN GOTO 100
20
IF A=7 THEN GOTO 200
Instead of typing both lines, type in line 10 and then use the
CTRL/UP ARROW keys to put the cursor over the 1 of 10 and type 2. Move
the cursor right with the CTRL/RIGHT ARROW keys until it is over the 6
and type 7. Move the cursor right again to the 1 of 100 and type 2. Now
press RETURN. All you will see is line 20, but now list the program.
Presto! Two lines for the price of one (almost). Use the editing
facilities whenever you see lines that are similar to lines you have
already typed and you will save a lot of time. Don't forget that you can
insert or delete characters in a line by using CTRL/ INSERT or
CTRL/DELETE.
Just for fun, try the following program. Put the word 'PRESS' in
inverse. More about PEEKs and POKEs in future issues.
10
? CHR$(125):? "PRESS SOME KEYS"
20
POKE 755,PEEK(764):GOTO 20
top