Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Goto doesn't work' topicStudent Support Forum > General > "Goto doesn't work"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
jf
12/16/12 7:02pm

Break and Continue are better documented.

The examples in the reference page for CompoundExpression all show the inputs on one line. There has always been a difference between inputs on the same line and when separated by new-line characters.

Putting your input all on one line gives you want you want, an infinite loop:

Label[zu]; Print["zuzu"]; For[i = 1, i < 10, i++,
If[i == 5, Goto[zu], If[i == 7, Goto[bu]]]]; Label[bu];

zuzu
zuzu
zuzu
zuzu
zuzu
zuzu
zuzu
zuzu
zuzu
zuzu
zuzu
zuzu
zuzu
zuzu
zuzu
zuzu
zuzu
zuzu
zuzu
zuzu
...



URL: ,

Subject (listing for 'Goto doesn't work')
Author Date Posted
Goto doesn't work PhysicsGuy 12/15/12 6:48pm
Re: Goto doesn't work jf 12/16/12 7:02pm
Re: Re: Goto doesn't work PhysicsGuy 12/16/12 8:50pm
Re: Goto doesn't work yehuda 12/17/12 09:05am
Re: Goto doesn't work Forum Modera... 12/17/12 10:50am
Re: Goto doesn't work Michael 12/17/12 12:10pm
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic