-
Notifications
You must be signed in to change notification settings - Fork 0
FOR
Andrew Owen edited this page May 30, 2023
·
2 revisions
FOR loop_var = start TO stop [STEP step]
Initiates a FOR
to NEXT
loop.
Initially, loop_var
is set to start
. Then, the statements between the FOR
statement and the NEXT
statement are executed and loop_var
is incremented by
step
(if step
is not specified, by 1
). This is repeated until loop_var
has
become greater than stop
. Execution then continues at the statement following
NEXT
. The value of loop_var
equals stop
+step
after the loop.
-
loop_var
is a numeric variable. -
start
,stop
andstep
are numeric expressions.
- No
NEXT
statement is found to match theFOR
statement: FOR without NEXT occurs at theFOR
statement. -
loop_var
is a string variable orstart
,stop
, orend
has a string value: Type mismatch. -
loop_var
is an array element: Syntax error. -
loop_var
is an integer variable and astart
,stop
orstep
is outside the range[-32768, 32767]
: Overflow.
- Press
RETURN
to return to this menu. - Enter the name of a
TOPIC
to display it. - Enter
EXIT
to return to BASIC.
Choose from the following topics: