Nested Loops Question

ARC

Well-known member
Joined
Sep 9, 2006
Messages
63
Location
Minnesota
Programming Experience
Beginner
Does a nested loop finish firing before the rest of the outer loop continues?

I'm trying to fill a 3d array with the following loop and I'm not sure if this is the correct way to do it.

Dim agrid(25, 25) As String

Dim x As Integer
Dim y As Integer

Dim num As Integer

num = 97

x = 0
y = 0


Do While x <= 25


Do While num <= 122
agrid(x, y) = num

num = num + 1
y = y + 1

Loop

num = 97
x = x + 1

Loop
 
Ooops

Oops, i saw what i did wrong. Sorry :)

Do While x <= 25

Do While y <= 25

agrid(x, y) = num
num = num + 1
y = y + 1
Me.RichTextBox1.AppendText(CStr(x) + "," + CStr(y) + Environment.NewLine)
Loop


x = x + 1
y = 0
Loop
 
Back
Top