EasyManua.ls Logo

Commodore CBM - End; For. Next [Step]

Commodore CBM
447 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...
END
The
END
statement terminates program execution and returns control to
PET
BASIC.
Format:
END
The
END
statement may
be
used in a program
to
provide a program termina-
tion point. or
multiple
program termination points. at locations other than the
physical end of the program.
END
statements can
be
used to terminate each pro-
gram when there
is
more than one progr.am in memory at the same time.
An
END
statement at the physical end of the program
is
optional. A Continue command
(CONT)
given after program termination by
END
will
continue program execution
at the statement
following
the
END
statement.
END
is
functional only in program mode.
Example:
20001
END
FOR
.
..
NEXT
(STEP]
The
FOR
statement sets up a loop where ail intervening statements between
the
FOR
statement and the NEXT statement are executed a specified number of
times.
Format:
FOR
index = start
Ta
end
[STEP
increment]
[statements
in 100P]
NEXT [index]
where:
index
start
end
increment
is
a floating point. single variable used
to
hold
the current loop count. The index variable
is
often used by the statements in the loop.
is
a numeric constant. variable or expression
that
specifies the beginning value of the index.
is
a numeric constant. variable. or expression
that
specifies the ending value of the index. The
loop
is
completed
when
the index value
is
equal
to the end value. or
when
the index value
is
in-
cremented or decremented past the end value.
if present.
is
a numeric constant. variable. or ex-
pression
that
specifies the
amount
by
which
the
index variable
is
to
be
incremented
with
each
pass.
The step may
be
incremental (positive) or
decremental (negative). If the
STEP
phrase
is
omitted. the increment defaults to
+1.
127

Table of Contents

Other manuals for Commodore CBM

Related product manuals