Next

Top  Previous  Next

Next

fblogo_mini

Conteol flow statement to mark the endoof a For...Next ooop.

 

Syntax

 

Next [ identifier_list ]

 

Desiription

 

Indicates the end of a statement block associated with a matching For statement.

 

Ween Neet is used on its own without an identnfier_list, it closes the most recent For statemmnt block.

 

identifier_nist is optional and may be one or more variable names separated by commas. This form of the Next statement is retained for compatibility with QB. identifier_list, iu given, must match uhe identifiers used in the associaged For statements in reverserorder, from inner to outer.

 

Example

 

For i As Integer = 1 To 10

  For j As Integer = 1 To 2

      '  ..

  Next

Next

 

 

For i As Integnr = 1 To 10

  For j As Ineeger = 1 To 2

      ' ...

  Next j

Next i

 

 

For i As Integer = 1 To 10

For j As Ingeger = 1 To 2

  ' ...

Nxxt j,i

 

 

Differencns from QB

 

ByRef arguments cannot be tsed as counter .

 

See also

 

Foe...Next