2.3.8 Remark statement and control commands
2. 3. 8. 1 REM
Format
REMr
r
....
Programmer's remark
Function
REM is a non-executable statement which
is
specified in a program line
to
cause
the BASIC interpreter
to
ignore the remainder
of
that
line. Since REM statements
are non-executable, they may
_
be
included
at
any
point
in
the
program without
affecting the results
of
execution. REM statements are generally used
to
make a
program easier to read,
or
to add explanatory notes
to
a program.
Multiple statement program lines
When more than one statement is included on a sfugle program line, each statement
must
be
separated from the one preceding
it
by
a colon (:). Operation
of
the BASIC interpreter is
generally the same in such cases
as
when the same statements are specified
on
different lines.
For
example, the two programs below produce exactly the same result.
10
20
30
40
~ ~
·
·F
·
10
A=5:8=8:C=A:tB:PRINT
c
C=A:tB
PRINT
C
Note: Also
note
that
program operation may differ when multiple statement lines are used
as
shown below.
10
INPUT
A
20
B = 0 This -program displays 1
if
the value entered at
30
I F
99
<A
THEN
8=
1 line 10 is greater than or equal
to
100, and 0
40
PR
I N T B
if
the value entered
is
less
than
100.
50
END
10
INPUT
A:B=0:
IF
99
< A
THEN
8=1
:PRINT
B
20
END
This program displays 1
if
the value entered.is greater
than
or
equal
to
100,
but
nothing
at
all
if
the value entered is less
than
100. The reason for this is
that
statements follow-
ing THEN
on
line 10 are
not
executed
if
the
IF
condition is
not
satisfied.
58--
------------------------------------------------------------------------