READ
is
generally executed in program mode.
It
can
be
executed in immedi-
ate mode
as
long
as
there are corresponding DATA constants in the current
stored program to
read
from.
Examples:
REM
10 DATA 1,2,3
20
READ
A,B,C
150
READ
C$,D,F$
160 DATA
ST~
170 DATA
14.5,"TM"
On
completion,
A=l
B=2
C=3
On
completion,
C$="STR"
0=14.5
F$="TM"
The Remark statement
(REM)
allows comments to
be
placed in the program
for program documentation purposes.
Format:
REM
comment
where:
comment
is
any sequence of characters.
PET
BASIC ignores Remark statements other than reproducing them in pro-
gram listings. Remark statements may
be
placed in the path of program execu-
tion, and they may
be
branched
to.
A Remark statement
is
terminated only by a
RETURN
(end of line). A Remark statement may
be
placed
on
a line of its own:
100
REM
comment
or it may
be
placed
as
the last statement on a multiple-statement line:
100
A=6+B:IF
A>10
THEN
20:REM comment
A Remark cannot
be
placed ahead of any other statements
on
a multiple-
statement line, since anything after a
REM
to the end of the line
is
treated
as
a
comment.
10
REM
BRANCH
IF
DONE:GOTO 200
treated
as
part of remark t
~d
REM
is
intended for program mode usage to document a stored program.
It
may
be
given in immediate mode.
Examples:
10
REM
****
* * * * * * * * * * * *
**
* *
***
20
REM
***PROGRAM EXCALlBUR***
30
GOTO
55:REM BRANCH
IF
OUT
OF
DATA
147