Editing and debugging JavaScript

To validate JavaScript code, select Debug | Start. The result of the validation appears in the Tasks tab

The JavaScript Editor and Debugger offers efficient features to trace the execution of a script. You can step through a code line-by-line or step through from one breakpoint to another. You can check the current value of a variable at any time.

NoteA comment line starts with two forward slashes // at the beginning of the line.

StepsStepping through the code

The JavaScript Editor and Debugger works without input data at the IN-port of the component. However, for best results, populate the IN-port with data before using the debugging features.

  1. Validate the script or switch to the debug mode.

    A green arrow, pointing initially to line 1, indicates the progress of the execution while stepping.

  2. Make sure the result message in the Task tab displays “Successful compilation.”

  3. To move to the next line, click the Step icon on the toolbar.

    At any point during stepping you can inspect the variable name and the current value. To do so, select the variable in the Navigator and right-click.

StepsAdd and removing breakpoints

Instead of stepping through the procedure line-by-line, you can include breakpoints at selected lines.

  1. Click the line where you want to set or remove a breakpoint.

  2. Right-click and select Add/Remove breakpoint.

StepsStepping to a breakpoint

  1. Click the Go icon on the toolbar for each step.

  2. Click the Go icon on the last breakpoint to execute the rest of the script.