![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Mar 2005
Posts: 5
Rep Power: 0
![]() |
For Each ... Next, Nested Array issues.
I am trying to perform a For Each Loop on a nested array and VB is yelling at me
The nested array structure is this. MainArray(0)
SubArray(0) = "Some String"
SubArray(1) = "Some String"
SubArray(2) = "Some String"
MainArray(1)
SubArray(0) = "Some String"
SubArray(1) = "Some String"
SubArray(2) = "Some String"Where SubArray always contains 3 total elements and MainArray can have any number of elements which are SubArray. Here is what I have. Private Sub ProcessArray(byref MainArray as Variant)
For Each SubArray In MainArrary
DoSomething SubArray(0), SubArray(1), SubArray(2)
Next
End SubFor Each control variable must be Variant or Object I've tried to declare SubArray before the loop like this. Dim SubArray(2) as Variant Dim SubArray() as Variant Can this just not be done in VB? Thanks in advance to anyone who posts. |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|