Next (statement): Difference between revisions

From BR Wiki
Jump to navigation Jump to search
m (moved Next (Statement) to Next (statement) over redirect)
Line 10: Line 10:


===Syntax===
===Syntax===
NEXT <numeric expression>
[[Image:Next.png]]
[[Image:Next.png]]



Revision as of 19:03, 24 April 2014

The Next (N) statement works in conjunction with the For statement to form a loop. NEXT calculates the next numeric variable and runs a loop test to determine whether or not execution of the loop should continue.

Comments and Examples

If the value of the numeric variable remains within the specified boundaries (as indicated in the For statement), the loop is re-executed. If it is not within the specified boundaries, control passes to the first executable statement after Next.

Used in conjunction with the UDIM internal function, a FOR/NEXT loop can be used to perform an action to each part of an array (in this case checking for selected check boxes:

00390     For I=1 to UDIM(box$)
00400         if box$(I)(1:1)="^" then ordered(I)=1 else ordered(I)=0
00410     next I

Syntax

NEXT <numeric expression>

Parameter

"Numeric variable" must be the same numeric variable that is listed in the corresponding For statement.