-
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_varis a numeric variable. -
start,stopandstepare numeric expressions.
- No
NEXTstatement is found to match theFORstatement: FOR without NEXT occurs at theFORstatement. -
loop_varis a string variable orstart,stop, orendhas a string value: Type mismatch. -
loop_varis an array element: Syntax error. -
loop_varis an integer variable and astart,stoporstepis outside the range[-32768, 32767]: Overflow.
- Press
RETURNto return to this menu. - Enter the name of a
TOPICto display it. - Enter
EXITto return to BASIC.
Choose from the following topics: