The script files (SFs) can be debugged in the same way the programs are debugged using the Source and Watches windows, that is, by executing SF step-by-step and up to the caret, with setting up the breakpoints and watching the variable values, etc. The Script Source window is designed for the source text debugging. If the Debug option is set up in the Script Files dialog, it will open automatically when starting SF.
When the StartCommandFile() function in one SF starts another SF, you can specify the parameter instructing it to enter the debugging mode and to open the Process window.
To view the value of certain SF variable in the Watches window, use the Add Watch command in the Script Source window menu or the Add Watch button on the toolbar. This can also be done manually in the Watches window. For example, if you need to view the value of the addr variable, which is used in SF named TEST, then place the #TEST#addr construct in the Watches window. If addr is declared public, that is, outside the function, then it shall be written as ##addr.
|