Author |
Message |
chalcids
|
Posted: Wed Nov 23, 2011 9:02 am Post subject: 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. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Zren
|
Posted: Wed Nov 23, 2011 11:35 am Post subject: 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
|
|
|
|
|
chalcids
|
Posted: Wed Nov 30, 2011 11:03 am Post subject: 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
|
Posted: Wed Nov 30, 2011 1:07 pm Post subject: RE:Goto command or coding |
|
|
Simply use a loop and a condition if you want to avoid rewriting code.
Turing: |
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]
|
Posted: Wed Nov 30, 2011 9:47 pm Post subject: 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
|
Posted: Wed Nov 30, 2011 10:07 pm Post subject: Re: Goto command or coding |
|
|
You sound like you'd need a procedure more so than you would a loop
Turing: |
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
|
Posted: Thu Dec 01, 2011 5:27 pm Post subject: Re: Goto command or coding |
|
|
yeah thats what i need thanks |
|
|
|
|
|
Sponsor Sponsor
|
|
|
|