EasyManua.ls Logo

Apple IIe - Page 72

Apple IIe
320 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...
72
Apple
lie
Users
Handbook
Branching Statements
20
INPUT
X
50
y =
0
100
IF
X = 1
THEN
Y = 1
200
PRINT
X:
PRINTY
Branching statements change
the
execution pattern
of
programs
from
their
usual
line
by
line
execution in ascending
line
number
order.
A
branching
statement
allows
program
control
to
be
altered
to
any
line
number
desired. The most
commonly
used
branching statements in
BASIC are
GOTO
and
GOSUB.
GOTO
takes
the
following
format:
GOTO
line
number
For
example,
the
following
program statement,
500
GOT0999
999
END
would
branch program
control at line
500
to
line
999.
Branching statements are
often
used
in
conjunction
with
con-
ditional
statements.
In
such a situation, the
normal
execution
of
the
program
is
altered
depending
upon
the
outcome
of
the
condition
set
up
in
the
IF
statement. This
is
shown
in
the
following
example.
100
INPUT "ENTER
THE
AMOUNT
";A
200
IF
A=
0
THEN
GOTO
900
300
PRINT A
400
GOTO
100
900
INPUT "FINISHED
";B$
910
IF
B$
=
"N"
THEN
100
999
END

Other manuals for Apple IIe

Related product manuals