Download Extended Cassette BASIC User`s Manual

Transcript
Elements of an array are referred to as follows:
var(exp1, exp2, ...)
For example:
10
20
30
40
50
60
70
80
100
110
120
130
DIM R(5,5)
FOR I = 1 TO 5
FOR J = 1 TO 5
These statements store 25
READ R(I,J)
values in matrix R.
NEXT J
NEXT I
INPUT "WHICH ELEMENT? ",A,B
PRINT R(A,B)
DATA 7.2, 8.4, 9.4, 8.6, 7.2
DATA 3.4, 3.7, 3.8, 9.5, 7.8
DATA 7.7, 2.1, 3.2, 5.4, 5.3, 7.6, 5.3, 6.4, 2.1, 2.0
DATA 4.8, 9.7, 8.6, 8.2, 11.4
When executed, this program prints the requested elements as
shown below:
User:
BASIC:
User:
BASIC:
RUN <CR>
WHICH ELEMENT? 2,3 <CR>
3.8
RUN <CR>
WHICH ELEMENT? 3,2 <CR>
2.1
The amount of storage necessary for a given array is given by:
9 + (dimension1) * (dimension2) * (dimension3) .....etc.
The amount of storage that can be assigned to a variable is
determined by the total storage available to BASIC. The memory
limit for BASIC can be changed using the command:
SET ML = exp
numerical expression
To find out how much free storage you have left at any time, use
the FREE(0) function, which prints the number of bytes of space
left for program and variables. For example:
PRINT FREE(0) <CR>
2960
5.5. USING CASSETTE TAPE FOR DATA STORAGE
The statements described in this unit allow you to store data on
cassette tape and retrieve it. When using tape, you have the
responsibility of rewinding the tape, positioning it past the
leader before writing on it, and not writing over data you want
to keep. Review unit 3.4.1 about working with cassette
recorders before storing data on tape.
5-18
BASIC