
                    Shortening your STOS listings

                        An article for STOSSER

                      Written by Jamie Blakeney


Shorter programs mean less typing, they also take up less memory space 
and make your program run faster too.  Below I have tried to explain 
some features and tips to make your programs smaller.

One of the most important rules to remember when writing a program is
to make it clear and easy to understand.  This usually means keeping
program lines short, adding lots of rems and space, and using long
variable names whenever possible.

However, long readable programs take up more space and they tend to
execute slower as well.

One way in which to shorten listings is to omit cetain keywords.
They are follows : -

 10 Let a$="STOSSER"

Can be shortened to

 10 a$="STOSSER"

O.k. Not much saved if you do it once, but if you have hundreds of
variables to fix then it could save quite a bit of time.

Another example is the IF....THEN....GOTO command:

10 If a$="STOSSER" then goto 20 else goto 30

Can be shortened to

10 if A$="STOSSER" then 20 else 30

Again not much saved if you do it once but in a game loop it could
save quite a considerable ammount of time.

To save memory space you should omit all REM statements when you come
to compile your program as these are not needed when the program is
compiled because you cannot view and/or change the file.

To save typing PRINT this can be shortened to ? also REM can be
shortened to  ' .

If you are short on memory space then you can of course group many
commands togather onto one program line.   Although not good
programming practice it does use less memory.  Commands should be
separated by a : .

One way to speed up programs  is  to  omit the variable after the NEXT
instruction when using the FOR .... NEXT structure.

These ideas should only be implemented  when you compile your programs
because if you do it in basic you wont be able to understand your
listing and wont have a clue what it's all about!!

Ah well .......... !EYB

Jamie Blakeney
