LOOPING THROUGH A 2-D STRING ARRAY !!!

J

jay dean

Hello !

I have a 2D string array, MyArray(110, 140). How do I loop through ONLY
the 2nd dimension (the 141 columns) referring to ALL the 111 rows in
EACH column as a SINGLE 1D array of (111 by 1) ?

Any help will be appreciated.

Thanks
Jay Dean


*** Sent via Developersdex http://www.developersdex.com ***
 
J

Joel

for i = lbound(MyArray,1) to ubound(MyArray,1)
for j = lbound(MyArray,2) to ubound(MyArray,2)
MyChar = MyArray(i,j)
next j
next i
next i


It may be better to use a single dimension array with each items in the
array is a string and usew the MID function to get each character

Dim MyArray(110) as String

for i = lbound(MyArray,1) to ubound(MyArray,1)
for j = 1 to len(MyArray(i))
Mychar = Mid(MyArray(i),1)
next j
next i
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top