OmniTrader Professional Forum
-
OmniLanguage Discussion
End Do statement? |
^ Top | ||
kmcintyre![]() Posts: 132 Joined: 9/12/2007 Location: Valley Center, CA ![]() | 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... | |
^ Top | ||
Jim Dean![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() | 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 | |
^ Top | ||
kmcintyre![]() Posts: 132 Joined: 9/12/2007 Location: Valley Center, CA ![]() | 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! |