FOR TO STEP
Format: FOR var = expr1 TO expr2 STEP expr3
Supported by: COMX BASIC V1.00, Floating Point BASIC 2.2, Pecom 32 BASIC, Pecom 64 BASIC 1.0 and 4.0, Quest Super BASIC 1.4, 3.0, 5.0 and 6.0, RCA BASIC3 V1.1, Telmac SBASIC v 24.3
Similar commands: -
This statement assigns to a variable the value of expr1. The program continues executing until a NEXT statement is encountered. At that time the value of the variable is incremented by the amount defined by expr3 which may be either positive or negative. Expr2 - var is then evaluated and compared to the sign of the step. It is assumed that zero has a positive sign. If a match in sign does not occur, execution resumes at the first statement after the last FOR statement and continues through the loop. At any time during the loop, the user can modify the value of the variable name by any available means (e.g., a LET statement). It should also be noted that the mode of the variable name sets the mode in which expr1, expr2, and expr3 are evaluated. If the STEP expr3 is deleted, a step size of one is assumed.