EasyManua.ls Logo

Commodore Plus 4 - Page 62

Commodore Plus 4
464 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
50
The
BASIC
Language
clause
is
ignored
and
execution
passes
to
the
next
line
in
the
program
or
to
the
ELSE
clause
if
one
is
present.
The
GOTO
clause
is
like
a
GOTO
command:
it
tells
the
computer
to
go
straight
to
a
specified
line
number
and
resume
execution
there.
The
line
number
can
be
anywhere
in
the
program.
IF
...
GOTO
...
ELSE
is
a
limited
variation
of
IF
...
THEN
...
ELSE.
Use
IF...
GOTO...
ELSE
instead
of
IF...
THEN...
ELSE
when
the
THEN
clause
would
contain a
GOTO
command
anyway.
Parameters:
true-false
condition
GOTO
line
number
:
ELSE
clause
1.
The
conditions
in
the
IF
command
can
use
comparison
operators
(=,
<,
>,
<>,
<=,
>=)
to
compare
values.
The
values
can
be
any
of
the
following:
Numbers
or
text
strings
Any
type of
variable
Variables
on
both
sides
of
the
comparison
operator
Mathematical
formulas
2.
The
line
number
after
GOTO
tells
the
computer
where
to
go
when
the
IF
condition(s)
is
(are)
true.
3.
The
ELSE
clause
contains
instructions
that
are
followed
only
when
the
IF
condition(s)
is
(are)
false.
The
ELSE
clause
is
always
optional.
It
must
be
separated
from
the
rest
of
the
command
by
a
colon.
Example:
10
IITRJT
X
Line
20
compares
the
value
input
for
X
to
0.
SO
IF
X
<=
0
GOTO
10
The
GOTO
command
executes
only
when
it
is
30
PRINT
X
true that
X
is
less
than
or
equals
0.
IF
...
THEN
...
ELSE
Abbrs.
if/tH/eL
IF
logical
value
THEN
commands
:
ELSE
commands
IF
is
a
compound
conditional
statement
that
checks
the
status
of
a condition
in
the
command
and
then
chooses
one
of
two
courses
of
action.
One
of
the
two
IF
command
options
is
stated
in
the
THEN
clause.
The
other
option
can
be
stated
in
an
ELSE
clause.
If
no
ELSE
clause
is
present,
execution
continues
with
the
next
line
in
the
program
when
the
condition
is
false.
The
status
of
the
IF
command
condition
determines
whether
the
THEN
clause
or
the
alternative
is
to
be
executed.
THEN
is
executed
when
the
IF
condition
is
true,
or
met;
ELSE
is
executed
when
the
IF
condition
is
false,
or
not
met.
The
computer
executes
either
the
THEN
clause
or
the
ELSE
clause,
but
never
both.

Other manuals for Commodore Plus 4

Related product manuals