2. Step through Scripts

Step through a script procedure

Step through a script tools

Step through a Script Procedure

Two methods are available to step through a script.

Both methods involve stepping through a script code line by line.

Method

Description

Single step

Steps into calls to user-defined functions and subroutines.

Procedure step

Does not step into calls to user defined functions and subroutines. The procedure step does execute the calls.

  1. Use either method to start stepping through your script with either the single step or procedure step method.

Method

Do one of the following.

Single step

Click Debug>Step on the CIMPLICITY Program Editor menu bar.

Press F8 on the keyboard.

Procedure step

Click Debug>Step Into on the CIMPLICITY Program Editor menu bar.

Press Shift + F8 on the keyboard.

The Program Editor places the instruction pointer on the sub main line of the script.

  1. Repeat the command as many times as necessary to continue stepping through..

Each time you repeat the Step command, Program Editor executes the line containing the instruction pointer and moves the instruction pointer to the next line to be executed.

  1. Do one of the following when you finish stepping through the script execution.

A

Click the Start button on the Application toolbar.

B

Click the End button on the Application toolbar.

C

Click Run>Start on the Program Editor menu bar.

D

Click Run>End on the Program Editor menu bar.

E

Press F5 on the keyboard.

Note: When script execution is initiated, the script will first be compiled, if necessary. Therefore, there may be a slight pause before execution actually begins. If the script contains any compile errors, it will not be executed.

Do the following.

  1. Correct any compile errors

  2. Initiate execution again.

  3. Repeat the Step command to continue stepping through the script line by line,

Step through a Script Tools

Calls dialog box

Set Next Statement

Calls dialog box

When stepping through a subroutine, you can determine the procedure calls made to arrive at the paused point in the script..

  1. Do one of the following.

A

Click Debug>Call Stack on the Program Editor menu bar.

B

Press Alt+D+K on the keyboard.

The Calls dialog box opens when you use either method.

The Calls dialog box lists the procedure calls made by the script to arrive at the selected subroutine.

  1. Do one of the following.

Click

Description

Show

  1. Select a procedure call in the Calls list.

  2. Click Show.

The Calls dialog box closes.

The Program Editor highlights the currently executing line in the procedure you selected, scrolling that line into view if necessary.

Close

Closes the Calls dialog box.

Help

Opens the Program Editor documentation.

Set Next Statement

When stepping through a subroutine, you can move the insertion point to another line within a subroutine to repeat or skip execution of a section of code.

  1. Place the insertion point in the line where you want to resume stepping through the script.

  2. Do one of the following.

A

Click Debug>Set Next Statement on the Program Editor menu bar.

B

Press Alt+D+N on the keyboard.

Result: The instruction pointer moves to the line you selected; you can resume stepping through your script from there.

Note: You can only use the Set Next Statement command to move the instruction pointer within the same subroutine.

More information

Debug scripts.