MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: GoTo between different cell

  • To: mathgroup at smc.vnet.net
  • Subject: [mg59442] Re: GoTo between different cell
  • From: David Bailey <dave at Remove_Thisdbailey.co.uk>
  • Date: Wed, 10 Aug 2005 02:55:27 -0400 (EDT)
  • References: <dd9ngj$j2h$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Ramiro dell'Erba wrote:
> Dear Mathematica Gurus,
> I have the following problem: working with repetitive operations I often 
> use the Do expression. Unfortunately the number of lines inside the Do are 
> growing (page and page) giving me a lot of notebook troubles (If I use 
> different colour and font the cell stop to work!) and difficulties to 
> follow the procedure in debugging phase (I need a lot of flags to check if 
> all is going good).
> Therefore, also if it seems a quite prehistoric idea, I want to break my 
> computation in many cells and to back N times to a certain cell to evaluate 
> them, something like the GoTo function but between different cell (perhaps 
> tagged).
> I know that sounds quite old but it is what I need.
> Thank you in advance to everybody.
> Ramiro
> 
> 
> PhD. Ramiro dell'Erba,
> Lab address:  ENEA  CR Casaccia
> ENEA - Nuclear Fusion Division, Robotic Section
> Edificio F65  Via Anguillarese 301, Roma 00060 Italy
> Sacco Postale 088
> Tel. 0039-06-30486128
> Fax 0039-06-30486038
> E-mail: dellerba at casaccia.enea.it
> URL: http://wwwrob.brindisi.enea.it
> Home address: Parco Comola Ricci, 39  Napoli 80122  Italy
> Tel. 0039-081-7691954
> Handy:Tel. 0039-347-5041920
> E-mail home:dellerba2 at iol.it

Hello,

You should try to think of notebook cells as convenient units of input - 
rather than something that you would think of jumping between. In a well 
structured notebook most cells will consist of definitions - say 
function definitions - and when you execute them the definition is sent 
to the kernel where it can really do something. Typically, the last cell 
will be an actual calculation that will use all the previous definitions.

A notebook is really quite analogous to the paper variety - it doesn't 
do much itself, but it is a repository for text and code that you can 
send to the kernel (and for results, of course).

If you have a large loop you should replace it with a much smaller loop 
which calls one or more functions that you have defined as described 
above. Remember also that functions can call other functions.

Yes - using different fonts etc. in executable code seems to expose some 
nasty bugs in the frontend WHICH I WISH (is anyone at Wolfram 
listening?) they would fix!

If you can, you would benefit enormously from a short Mathematica 
course. On any such course they will show you how to organise your code 
conveniently, and also lots ways to code more elegantly.

David Bailey
http://www.dbaileyconsultancy.co.uk


  • Prev by Date: Re: Mathematica goes Bad
  • Next by Date: Re: newbie problem with differential equation
  • Previous by thread: Re: GoTo between different cell
  • Next by thread: Mathematica goes Bad