User`s manual

11-1
11 / Saving Time and Space
Most LEVEL II programs are faster and take up less memory
space than their LEVEL I counterparts. But even with its
inherently more efficient features, LEVEL II can be further
streamlined by following a few simple guidelines when
constructing your program.
Saving Memory Space
1)
When your program is operating properly, delete all unnecessary REM
statements from your running version.
2)
Do not use unnecessary spaces between statements, operators, etc.
3)
When possible, use multiple-statement program lines (with a colon
between each two statements). Each time you enter a new line number it
costs you 5 bytes.
4)
Use integer variables whenever possible, for example,
FOR I% = 1 TO 10
Integers take only five bytes. Single precision takes 7 and double precision
takes 11 bytes.
5)
Using subroutines will save program space if the operation is called from
different places several times. If a routine is always called from the same
place, use unconditional branches (GOTO's). Each active GOSUB takes 6
bytes; a GOTO takes none at Run time.
6)
Structure your calculations so as to use as few parentheses as possible
(refer to Chapter 1, "Arithmetic Operators"). It takes 4 bytes to process
parentheses. And since these operations inside parentheses are done first,
the result of each parenthetical expression must be stored (this takes 12
bytes).
7)
Dimension arrays sparingly. When you set up a matrix, the Computer
reserves 11 subscript addresses for each DIMension, even if the space is not
filled. Use the zero subscripted elements, since they are always available.
8)
Use DEF statements when you will be working with values other than
single precision (strings, integers and double precision). A DEF statement
takes 6 bytes but this is made up for fairly quickly since you don't need to use
type declaration characters with the variable names.