Re: Re: debugging

*To*: mathgroup at smc.vnet.net*Subject*: [mg56726] Re: [mg56716] Re: [mg56676] debugging*From*: "Hermann Schmitt" <schmitther at t-online.de>*Date*: Thu, 5 May 2005 06:01:10 -0400 (EDT)*References*: <200505030926.FAA25668@smc.vnet.net> <acbec1a40505031010638fa9d4@mail.gmail.com> <1115144101.31794.55.camel@30-5-214.wireless.csail.mit.edu> <200505040434.AAA06275@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

----- Original Message ----- From: "Chris Chiasson" <chris.chiasson at gmail.com> To: mathgroup at smc.vnet.net Subject: [mg56726] [mg56716] Re: [mg56676] debugging > Do you mean it wasn't an error that referenced a line number? Some > errors in Mathematica do come with line numbers; I thought you had one > of those kind and were just looking for a way to display line numbers. > In my case a line number was displayed, but it was not correct. The error was caused by ToExpression[] and I have many those statements in my program, therefore the program name did not help. I think, that the following statement helps very much, because the program stops at the statemetn in error. $MessagePrePrint = (Print["Error -> Quit"]; Quit[])&; > You could add your own type checking/debugging code that will produce > its own warning messages. That would help you locate the problem. > > I usually start from the name of the function that produces an error > and tear my function apart, call by call, until I find the step > between which the output went from good to bad. > > You may find ctrl+shift+b useful for this. You may also wish to make > use of the Interrupt[] , Abort[] and Throw/Catch calls. > > On 5/3/05, Daniel Roy <droy at mit.edu> wrote: > > There are no line numbers in the reported bugs, of course. > > > > On Tue, 2005-05-03 at 13:10 -0400, Chris Chiasson wrote: > > > You could load the code into the vi editor (or your favorite text > > > editor) and turn on the line numbers. > > > > > > On 5/3/05, Daniel Roy <droy at mit.edu> wrote: > > > > > > > > My question concerns debugging. I've done googling to find a quick > > > > answer but have failed. I'm developming large functions and without > > > > line numbers telling me where the errors occurred, its becoming very > > > > difficult to develop code quickly. Can anyone point me in the right > > > > direction in terms of debugging multi line (at least 50+ lines) > > > > functions? > > > > > > > > thanks, > > > > dan > > > > > > > > > > > > > > > > > > > > > -- > Chris Chiasson > http://chrischiasson.com/ > 1 (810) 265-3161 >

**References**:**debugging***From:*Daniel Roy <droy@mit.edu>

**Re: debugging***From:*Chris Chiasson <chris.chiasson@gmail.com>