BASIC-SO Commands and Statements
PUT
file
number,
[sector
number]
10 OPEN
"R",
1,
":F1:FILE.1"
20
FIELD 10 AS A$
30
INPUT
A$
40
PUT 1,1
50
CLOSE
1
60
STOP
RUN
?
"A
STRING"
Ok
RANDOMIZE
The RANDOMIZE statement prompts the user for a
new
random number seed for
the random number function RND.
If
the RANDOMIZE command
is
not
given
within a program, the same sequence of random numbers will repeat each time any
program
is
run.
RANDOMIZE
[(expression)]
If
the optional expression is included, its value becomes the
new
seed and no prompt
is
issued.
10
RANDOMIZE
20
A=
RND
30
IF A < .5
THEN
PRINT
"HEADS"
40
IF A
>=
.5
THEN
PRINT
"TAILS"
RUN
Random
number
seed
(0-65529)?
123
TAILS
Ok
READ
The READ statement sequentially assigns values found in the accompanying DATA
statements to the variables specified.
If
more DATA fields are read than are
available,
an
OUT
OF
DATA
error message will be printed.
If
there
is
still data
available to be read, the next READ statement will assign the next datum to the
specified variable. The READ pointer may be reset to the first item
of
any DATA
statement with the
RESTORE command. Any type
of
variable may be read as long
as the type
of
the DATA
is
appropriate for the type
of
variable.
READ
variable
[,variable]
...
10
DATA
2,4,6,8,10,12,14,16,18,20
20
READ A, B,C,
30
PRINT A;
B;C
40
READ
D,E,F
50
PRINT
D;E;F
RUN
246
81012
Ok
6-19