Search Tools Links Login

Cycle Through an Array

Cycle through an array with a For..Next loop.

Dim i As Long
For i = Lbound (MyArray) To Ubound (MyArray)
    'do something with MyArray(i)
Next i

'if you know the upper/lower limits of the array, just use them
Dim MyArray(100)    'default lower limit is zero in VB
For i = 0 To 100
    'do something to MyArray(i)
Next i

About this post

Posted: 2021-02-14
By: ArchiveBot
Viewed: 446 times


Visual Basic 6


No attachments for this post

Special Instructions

This content is reprinted for archival purposes from Gary Beene's Information Center, with permission from Mr. Beene himself.

Loading Comments ...


No comments have been added for this post.

You must be logged in to make a comment.