Author Topic: Idea to fix Repeat\Goto  (Read 4844 times)

0 Members and 1 Guest are viewing this topic.

Offline Crome969Topic starter

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Idea to fix Repeat\Goto
« on: July 29, 2011, 11:16:23 AM »
+1
Hello Community,
i noticed in TMs Pathfind that he working a lot with breaks
i thought a little bit about this issue and have maybe a solution:

function Goto(Mode,Statement)
if(Mode=="Set")then
myMode = Statement
end
if(Mode=="Get")then
Return MyMode
end
end




while(Goto("Get",false)==true)do -- ask if Goto true
.... --Your Code
if(...)and(Goto("Get",false)==true)then
... --Your Code
else
Goto("Set",true) -- set Goto to false and end loop
end
end

Its nearly like i solve my Problems

Another Possibility is to insert the looped Code in a function with a return
Example:

function Yourfunction(Yourparameter)
.. -- Your Code here
return "anyStatement" -- true or false
end

and then make


a = false
while(Yourfunction(Yourparameter)==false)do
 a = Yourfunction(Yourparameter)
end


Iam fresh to Openuo but maybe this Idea helps someone of you

best Regards Crome

Tags: