Name

For Each...Next Statement

Synopsis


For Each element In group
[statements]
[Exit For]
[statements]
Next [element]
element required; Object or any user-defined object type

An object variable to which the current element from the group is assigned

group required

An object collection or array

statements optional

A line or lines of program code to execute within the loop

Description

Loops through the items of a collection or the elements of an array.

Get VB.NET Language Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.