OmniTrader Professional Forum OmniTrader Professional Forum
forums calendars search
today this week
 
register logon control panel Forum Rules
You are currently browsing as a guest.
You should logon to access more features
A Self-Moderated Community - ALL MEMBERS, PLEASE READ!
Vote for Members who contribute the most to your trading, and help us moderate content within the Forums.


  Current location        Thread information  
OmniTrader Professional Forum
OmniLanguage Discussion
End Do statement?
Last Activity 7/6/2025 3:47 AM
2 replies, 1383 viewings

Jump to page : 1
Now viewing page 1 [25 messages per page]
 
back reply
Printer friendly version

^ Top
kmcintyre

Veteran
10025
Posts: 132

Joined: 9/12/2007
Location: Valley Center, CA

User Profile
 
Subject : End Do statement?
Posted : 6/23/2018 7:18 PM
Post #30089

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

Sage
2000100010010010010025
Posts: 3433

Joined: 3/13/2006
Location: L'ville, GA

User Profile
 
Subject : RE: End Do statement?
Posted : 6/23/2018 7:55 PM
Post #30090 - In reply to #30089

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]

^ Top
kmcintyre

Veteran
10025
Posts: 132

Joined: 9/12/2007
Location: Valley Center, CA

User Profile
 
Subject : RE: End Do statement?
Posted : 6/23/2018 11:11 PM
Post #30091 - In reply to #30090

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!

Jump to page : 1
Now viewing page 1 [25 messages per page]
back reply

Legend    Action      Notification  
Administrator
Forum Moderator
Registered User
Unregistered User
E-Mail this thread to a friend
Toggle e-mail notification


Nirvana Systems
For any problems or issues please contact our Webmaster at webmaster@nirvsys.com.