5.1. Add a Watch Variable to the Program Editor's Watch Variable List
About this task
- Select Variable Procedure
- Guidelines for Variables
Select Variable Procedure
Procedure
Results
The selected Variable is added to the Add Watch list.
If this is the first variable you are placing on the watch variable list, the watch pane opens far enough to display that variable. If the watch pane was already open, it expands far enough to display the variable you just added.
- The following variables can or cannot be watched.
Cannot watch
Complex variables such as structures or arrays.
Can watch
- Variables of fundamental data types.
Examples
- Integer
- Long
- Variant
- Individual elements of arrays or structure members using the following syntax:
[variable [(index,...)] [.member [(index,...)]]...]
Where
variable
|
= Name of the structure or array variable, |
index
|
= Literal number |
member
|
= Name of a structure member. |
Example
The following are valid watch expressions:
Watch Variable | Description |
a(1) | Element 1 of array a |
person.age |
Member age of structure person .
|
company(10,23).person.age |
Member age of structure person that is at element 10,23 within the array of structures named company
|
- If you are executing the script, you can
- Display the names of all the variables that are in scope or defined within the current function or subroutine on the drop-down Variable Name list.
- Select the variable you want from that list.
- You can add as many watch variables to the list as you want.
The Watch pane only expands until it fills half of Program Editor's application window. If your list of watch variables becomes longer than that, you can use the watch pane's scroll bars to bring hidden portions of the list into view.
- The list of watch variables is maintained between script executions.