Re: goto and label
- To: mathgroup at smc.vnet.net
- Subject: [mg57776] Re: goto and label
- From: Bill Rowe <readnewsciv at earthlink.net>
- Date: Wed, 8 Jun 2005 03:21:24 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
On 6/7/05 at 2:03 AM, guyi1 at netvision.net.il (Guy Israeli) wrote: >can someone give clearer instruction on how to use Goto and label >than the help offers? Here is an example from the help browser: In[1]:= q = 2; Label[begin]; Print[q]; q += 1; If[q < 6, Goto[begin]] But note, the same result could have been achieved with q = 2; While[q < 6, Print[q]; q += 1] without the label. Even better using functional programming Print/@Range[2,5] The point is while Mathematica has Goto, it isn't needed in practice. -- To reply via email subtract one hundred and four