How could I debug code in an standalone?

Graham Samuel graham.samuel at blueyonder.co.uk
Wed Mar 17 16:41:45 EST 2004


On Tue, 16 Mar 2004 17:48:56 -0800 (PST), Alejandro Tejada 
<capellan2000 at yahoo.com> wrote:
>[...]
>Did you have an strategy to debug code in an
>standalone?
Hi Alejandro

This may be far too simple for your purposes, but when I had a problem like 
this I adapted a timer handler I had in the mainstack of my application 
which originally just recorded a time stamp against a bit of text, so you 
called it like

  lfpTimer "Initialisation begins"

And this text plus a time got put into a field which I could look at later. 
When I got into trouble with my standalone, I changed the timer handler to 
write to a text file instead of an internal field. I scattered calls to the 
handler around sensitive areas of my app, and added other info in the 
recorded string e.g. the contents of specific globals. I could then open 
the text file in a text editor when my app failed and thus could see just 
how far it had got before it went off the rails. When I had fixed it and 
before the final build, I replaced the timer handler script with an empty 
body - in my case there was no noticeable performance hit arising from the 
calls themselves. Simple-minded, but it helped me.

HTH

Graham


---------------------------------------------------
Graham Samuel / The Living Fossil Co. / UK & France  




More information about the use-livecode mailing list