ScriptPro Editor This topic is for use by scriptwriters who are using ScriptPro Editor to create custom scripts for their agencies. Agents can go to Using ScriptPro Scripts for more information about using custom or standard scripts within Travelport Smartpoint. |
Debugger/Replay
This section provides information about:
- Debugging your code by using a replay method
- Walking through your code to validate variables
- Setting breakpoints
- Creating a Watch
Replay overview
The ScriptPro Editor offers a method of recording the steps taken while running the script. After the steps have been taken, the recording can be replayed inside the Editor. This replay allows the developer to walk through each step of the code or create breakpoints to validate variables.
Note: Scripts compiled prior to ScriptPro Version 6.1 will not contain a replay info.
Replay menu
The Replay menu has the following options.
Menu option |
Description |
---|---|
Load Replay File |
Load the recorded file to be replayed through the code. |
Start Replay |
Begin the process of walking through the code. |
Step Next |
Move to the next step of the code. |
Stop Replay |
Exit the replay. |
Toggle Breakpoint |
Move to the next breakpoint. |
Clear Replay State |
Removes all the variables from the Autos Window in the Replay Results window. |
Delete All Breakpoints |
Removes all breakpoints from the Replay Results window. |
Generate Replay Info |
Begin the process of recording the replay. |
Generate Replay Info
-
From the Replay menu, select Generate Replay Info to begin recording.
You can confirm that Generate Reply Info is turned on by opening the WKSTN.ini file. A new line will be added with GenerateReplayInfo equal to True or False based on the selection in the editor.
-
In Smartpoint, run the script completely.
-
Close the Smartpoint browser window.
Load Replay File
-
In the ScriptPro Editor, open the ASL script develop file which was recorded.
-
From the Replay menu, select Load Replay File. A browser window displays where the Replay files are saved by default.
-
Select the .spr file that contains the same name as the ASL file.
-
The Replay Results window displays.
The first functioning line is highlighted in blue.
Setting Breakpoints
Breakpoints are used to step to a specific line of code without stepping through each line of the code.
-
Find the line you would like to watch and place the cursor on that line.
-
Press F9, or select the Replay menu item then select Toggle Breakpoint. Turn the breakpoint off by pressing F9 or by selecting the Replay menu then Toggle Breakpoint.
-
The line is highlighted.
-
The breakpoints are also listed in the Replay Results window. The filename followed by the line number is listed.
Note: If you have multiple breakpoints a scroll bar will appear.
Stepping through the code
Based on the recorded Replay file, you can step through each line of code or skip straight to a breakpoint.
-
Load the Replay file and your first line of code will be highlighted in blue.
-
Press F10 or select Step Next from the Replay menu to move from line to line through the code.
-
After each line that contains a variable that changes value, the Autos window will update with the variable name and value.
Note: Only variables with new values will show. Only 5 variables will be seen at one time.
Watching a variable
As you step through, specific variable values can be watched.
-
Type the variable in the left column that you wish to watch in the Watch window in the Replay Results window.
-
Step through the code as normal using F10 or F5 through breakpoints. The values will display automatically after passing the line of code where the value changed.
Note: Only 5 variables can be watched. To no longer watch a variable, highlight and delete the variable name.