|
-
Feb 15th, 2000, 06:45 PM
#1
I've got this simple Do While Not..Loop structure that should work. It doesn't, and returns an error that there is a 'Loop without Do' - if I remove the loop line I get a 'Do without Loop' error.
This is exactly the same if I try a For..While..Next structure as well.
Can someone please help me out of this paradox!!
-
Feb 15th, 2000, 06:51 PM
#2
Frenzied Member
A Do loop has the following syntax;
Do {While | Until} condition
[statements]
[statements]
Loop
or
Do
[statements]
[statements]
Loop {While | Until} condition
A While..Wend loop has the following syntax;
While condition
[statements]
Wend
If this helps..
------------------
Mark "Buzby" Beeton
VB Developer
[email protected]
-
Feb 15th, 2000, 07:43 PM
#3
Here's my exact code:
If remvar = 3 Then
i = 0
b = 0
Do While Not b = c
Do While Not i = 6
'Do stuff with i
i = i + 1
Loop
b = b + 1
i = 0
Loop
End If
Its the inner Do...Loop that returns the error first - if I remove that loop the other one returns the error.
A few lines above, in the same procedure, there is a almost identical Do...Loop structure that doesn't return any errors...
Has anyone heard of this happening before?
Mafro still
-
Feb 15th, 2000, 07:50 PM
#4
Frenzied Member
Have you tried it with
Do While i<>6
and
Do While b<>c
?
this may help.
------------------
Mark "Buzby" Beeton
VB Developer
[email protected]
-
Feb 15th, 2000, 08:25 PM
#5
I worked it out! I had a If loop within the middle Do loop which was missing its End If at the end.
This was causing VB to think there was an extra 'Loop' inside the If loop where it wasn't needed...
Thanks for trying!
I'll read my code harder next time!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|