Studio:Debugging Helps

From STRIDE Wiki
Revision as of 22:47, 4 February 2008 by Timd (talk | contribs)
Jump to navigation Jump to search

Script Debugging Techniques

Listed here are some debugging techniques.

perl

PrintMessage()

The studio object provides a way to perform printf-style debugging of scripts running within STRIDE Studio.

PrintMessage allows you to log messages from running scripts and view the values of variables during script execution.

Here's an example of its use in a perl script:

my $funcs = $main::ascript->Functions;

# loop through each captured function
foreach (0..($funcs->Count - 1)) {
   my $f = $funcs->Item($_);
   # send output to Studio Messages window
   $main::studio->Output->PrintMessage("function item ".$_." ".$f->Name);
}

Note that the single argument to the function will accept any expression that perl can interpret as a string.

PrintMessageOutput.jpg

  • MessageBox()
  • exception messages


JScript

  • PrintMessage()
  • MessageBox()
  • exception messages
  • symbolic debugger