
-----------------------------------
chalcids
Wed Nov 23, 2011 9:02 am

Goto command or coding
-----------------------------------
I need coding or a command that I could use to go to a line or go to a variable!
Please it I need some code or logic.

-----------------------------------
Zren
Wed Nov 23, 2011 11:35 am

RE:Goto command or coding
-----------------------------------
What are you trying to do? Why do you need to go to a specific line? Would a loop not solve this? What about calling specific lines in a procedure?

-----------------------------------
Tony
Wed Nov 23, 2011 1:45 pm

RE:Goto command or coding
-----------------------------------
Nope. You didn't "want" a goto since at least 1968"need" it after 1973[1]

So if you don't want a goto... and don't need to use it... what exactly are you asking?

[1] http://dl.acm.org/citation.cfm?id=362947
[2] http://dl.acm.org/citation.cfm?id=362337

-----------------------------------
chalcids
Wed Nov 30, 2011 11:03 am

Re: Goto command or coding
-----------------------------------
I need it because in my program i need it to go from line 22 to line 609 because i don't want to rewrite the same code again besides the goto command is not bad for some it might fro others it is a life saver

-----------------------------------
Dragon20942
Wed Nov 30, 2011 1:07 pm

RE:Goto command or coding
-----------------------------------
Simply use a loop and a condition if you want to avoid rewriting code.


var thing : int := 0

loop
    if thing = 5 then
        do
        something
    end if
    
    thing += 1
    put thing
end loop


That way, you dont need to write "thing += 1" 5 times before presenting the condition.

-----------------------------------
[Gandalf]
Wed Nov 30, 2011 9:47 pm

RE:Goto command or coding
-----------------------------------
Or better yet, it sounds like you want to split your code up into procedures, which are like gotos but better!

-----------------------------------
Amarylis
Wed Nov 30, 2011 10:07 pm

Re: Goto command or coding
-----------------------------------
You sound like you'd need a procedure more so than you would a loop


procedure ProcedureName
    Code
end ProcedureName



/*
 * Calling a procedure. I'm guessing you would be using an if statement?
 */



if condition then
    ProcedureName
elsif condition then
    Something else
end if



-----------------------------------
chalcids
Thu Dec 01, 2011 5:27 pm

Re: Goto command or coding
-----------------------------------
yeah thats what i need thanks
