Script Debugger

www.kxcad.net Home > Electronic Index > Altium(Protel) Index


Your Ad Here

The Script Debugger provides you with full featured debugging environment in its own window separate but linked to DXP. The script that compiles correctly doesn’t always work as planned. This usually boils down to problems such as errors in logic, invalid assumptions, misplaced grouping operators and typographical errors.

To use the script debugger, you need to have the script open in the debugger which is a separate application linked to the DXP application. You cannot edit the contents of a script in the debugger, but you can define expressions, breakpoints, trace the script in the debugger.

Script Errors

The Delphi Script’s debugger permits you to intercept exceptions, trigger break points, evaluate expressions, and more. Script Errors can be one of the following:

• Design Time Errors

• Compile Time Errors

• Run Time Errors

• Logical errors

Debugging scripts

When you encounter errors in the script, you will debug the script to resolve the errors and the Script Debugger provides some ways to find and resolve errors (bugs). To break out of the debugging mode, you can either finish executing the script or stop the script.

The process of executing script one line at a time is referred to tracing or script stepping. The Script debugger provides options related to tracing: stepping into and stepping over. When you are debugging a script, you can trace the script and watch certain expressions. The following keystrokes are useful when tracing through code.

Step Into (F8)

The Step Into process executes script one statement at a time. If the statement being executed calls another procedure, stepping into that statement simply transfers control to the first line in the called procedure. The blue line on a script indicates the current line where the script is up to.

Step Over (Shift F8)

The Step Over process is similar to Step Into, except that if the current statement is a call to another procedure, the entire called procedure is executed without stopping rather than tracing through the called procedure. So for example, stepping over the statement, ProcB; in the previous procedure executes procedure ProcB and stops at the next line ProcC; in Procedure ProcA. This is useful if we are certain that the Procedure ProcB is not the cause of our problem and we don’t want to trace through that procedure line by line.

Run (F5)

When the key/button is pressed, the script is executed depending on where the cursor is at, for example at the beginning of the script or continuing from the point where it was interrupted due to a breakpoint.

Run to Cursor (Ctrl F8)

When this Run To Cursor key/button is pressed, whenever the cursor is on the script, the script is paused at where the cursor is.

Stop (Shift F5)

When this Stop key/button is pressed, the script is halted in DXP.

Toggle Breakpoint (F9)

Hitting the F9 key or clicking on the White Hand button from the toolbar toggles the breakpoint on the current line of the script (where the cursor is at).

Your Ad Here