The Dink Network

Loops

July 29th 2004, 02:13 PM
spike.gif
If I have many loops with the same name in a script and I then do goto loop; which of them will I end up at?
July 29th 2004, 02:59 PM
anon.gif
Vedran
Ghost They/Them
 
You mean this:

void main ( void )
{
goto start;

loop:
say("1", 1);
goto end;

loop:
say("2", 1);
goto end;

loop:
say("3", 1);
goto end;

start:
goto loop;

end:
}

Just check it yourself: assign it to a key, press it in the game and see which number is shown. In this case it is 1.
July 29th 2004, 03:14 PM
spike.gif
Sure, I could do that. but I'm LAZY man! but perhaps now that you wrote the example script for me...
July 29th 2004, 05:18 PM
wizardb.gif
merlin
Peasant He/Him
 
Judging from Seth's parsing algorithm, you'll end up at the third one. But, if it was a DECENT parser *cough*, you wouldn't be able to run the script.