NEXT
 
Syntax

NEXT [ identifier_list ]

Description

Indicates the end of a statement block associated with a matching FOR statement. identifier_list, if given, must match the identifiers used in the associated FOR statements in reverse order.

There should be exactly one NEXT statement (or one item in the identifier list) for every FOR statement.
Example

FOR i=1 TO 10
FOR j=1 TO 2
   ...
NEXT
next

FOR i=1 TO 10
FOR j=1 TO 2
   ...
NEXT j
NEXT i

FOR i=1 TO 10
FOR j=1 TO 2
   ...
NEXT j,i


See also