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

0 Members and 1 Guest are viewing this topic.

Offline Crome969Topic starter

  • RebirthUO - Developer
  • Elite
  • *
  • *
  • Posts: 2090
  • Activity:
    0%
  • Reputation Power: 24
  • Crome969 might someday be someone...Crome969 might someday be someone...Crome969 might someday be someone...Crome969 might someday be someone...
  • Gender: Male
  • StealthUO - Developer
  • Respect: +210
  • Referrals: 9
    • View Profile
    • RebirthUO - UO Freeshard
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: