Watching a script run

Pazleysox

Member
Is there a setting so I can watch what a script does? I have a script that's getting hung up, and I don't know on what line. I wanted to know if I can see the code as the script is being run?
 

Darzil

Developer
When I am doing something like that I add code to the script that prints out what it is doing, and maybe variable values, to help debugging.
 

fronobulax

Developer
Staff member
If the script author used zlib for print statements, adjusting the verbosity may generate output that gives you warm fuzzy feelings. Lots of examples for you to find if you are the author :)

Like Darzil, I deal with debugging by adding print statements. Where to put them is an art and the better you know your code the faster you will find out where useful statements go. I often print something at the start and end of loops, for each iteration in a loop and prehaps a variable or two before a decision point (if statement).

If you have enabled stack traces on abort and you mash the stop now button and the stars align you should be told where the script was when it stopped. That may or may not be related to what it was actually doing when you mashed the button but sometimes it will point you in the right direction.
 

Pazleysox

Member
Adding print to my script is what I've done in the past. I'm Workin on a partial script from someone else, trying to bend it to my will.
 

xKiv

Active member
Technically, you can enable "debug ash", but that's not exactly the right level of detail for most of us, and not exactly the kind of information most of us expect.
 
Top