|
kmcintyre
 Veteran
  Posts: 132
Joined: 9/12/2007
Location: Valley Center, CA
User Profile |
dim iPigs as integer
iPigs = 5
Do While iPigs > 0
if iPigs = iPigsFlyingLimit then
end Do
else
iPigs = iPigs - 1
end if
Loop
Why does the OL compiler barf on this? The End Do
statement appears to be the issue. But why?
Is there another way to break out of a Do loop?
Also, End While doesn't seem to be supported.
help with iteration please...
|
|
Jim Dean
 Sage
       Posts: 3433
Joined: 3/13/2006
Location: L'ville, GA
User Profile |
Two things
PigsFlyingLimit is not defined
Although I rarely use Do While, as I recall the proper exit is End Loop
I trust you realize the logic is redundant ... it would be tighter if PigsFlyingLimit was defined ahead of time and that was part of the Do While .. you wouldn't need the test inside the loop
Do While iPigs > 0 and iPigs <> iPigsFlyingLimit
iPigs = iPigs - 1
Loop
[Edited by Jim Dean on 6/23/2018 7:59 PM]
|
|
kmcintyre
 Veteran
  Posts: 132
Joined: 9/12/2007
Location: Valley Center, CA
User Profile |
The pigs flying example was simply to show the construct I was working with.
After working with the End Do statement actually compiled ok.
Thanks for the help!
|