en:for [BASIC 256 - Language Documentation]

# BASIC 256 - Language Documentation

en:for

## For / Next (Statement)

### Format

for numeric_variable = start_expr to stop_expr [ step step_expr ]
statement(s)
next numeric_variable

### Description

The FOR and NEXT commands are used in conjunction to execute a command or group of commands a specified number of times. When the FOR command is first encountered, the numeric_variable is set to start_expr.
After each NEXT command, numeric_variable is incremented by 1 (the default), or by step_expr if the optional STEP is used, until numeric_variable is greater than or equal to stop_expr for positive step values, or less than or equal to stop_expr for negative step values.

### See Also

Begin Case / Case / End Case, Call, Continue Do, Continue For, Continue While, Do / Until, End, Exit Do, Exit For, Exit While, For / Next, Function, Global, Goto, Gosub, If Then, Pause, Ref, Rem, Return, Subroutine, While / End While

en/for.txt · Last modified: 2014/02/07 12:48 by admin