-
Hi,
I'm a newbie (you can tell by my questions), I'm building a project with a nested loop, I keep getting a compile error saying loop with out do, but the do is there and both loops work outside of each other just not together, any idea's?.
Thanks!!
-
It might be easier if you show us the code you are using... though it sounds like you aren't terminating one of the loops properly.
Here is an example from the Visual Basic Help file (Under 'Do'):
Code:
Dim Check, Counter
Check = True: Counter = 0 ' Initialize variables.
Do ' Outer loop.
Do While Counter < 20 ' Inner loop.
Counter = Counter + 1 ' Increment Counter.
If Counter = 10 Then ' If condition is True.
Check = False ' Set value of flag to False.
Exit Do ' Exit inner loop.
End If
Loop
Loop Until Check = False ' Exit outer loop immediately.
Hope this helps.
Michael
-
Check all the structures you´re using. I can bet that the problem is an If without end if. Check all the if, for, do, select case... every structure.
Send us the code...
-
Indenting your code is usually the best solution! You'll see the missing end X immediately! :)