The Variable Watch window displays current variable values after IDL has completed execution. If the calling context changes during execution - as when stepping into a procedure or function - the variable table is replaced with a table appropriate to the new context. While IDL is at the main program level, the Watch window remains active and displays any variables created.
To hide the Variable Watch window, select Window ® Hide Variable Watch. Select Show Variable Watch to make it reappear. Changing the Window menu will only affect the current IDL session.
To apply your changes to future sessions, select File ® Preferences and click the Layout tab. In the section labeled Show Windows, select or clear check boxes associated with the windows you want to appear. Click Apply to save your changes for future IDL sessions and OK to exit.
| Note |
The Variable Watch window is refreshed after the IDLDE has completed execution. Each Variable Watch window contains the following folders:
This tab contains descriptions of local variables. Local variables are created from IDL's main program level. For example, entering a=1 at the Command Input Line lists the integer a in the Locals tab.
This tab contains descriptions of parameters. The variables and expressions passed to a function or procedure are parameters. For more information, see Parameters.
This tab contains descriptions of variables contained in common blocks. The name of each common block is shown in parentheses next to the variable contained within it. For more information, see Common Blocks.
This tab contains descriptions of system variables. System variables are a special class of predefined variables available to all program units. For more information about system variables, see System Variables.
Each tab contains a table listing the attributes of the variables included in the category. You can size the columns by clicking on the line to the right of the title of the column you wish to expand or shrink. Drag the mouse either left or right until you are satisfied with the width of the column. For example, to change the width of the Name column, click and drag on the line separating the Name field from the Type field.
The following fields describe variable attributes:
This field shows the name of the variable. This field is read-only, except for array subscript descriptions (see example in Using the Variable Watch Window below).
For compound variables such as arrays, structures, pointers, and objects, click the "+" symbol to the left of the name to show the variables included in the compound variable. Click the "-" symbol to collapse the description.
This field shows the type of the variable. This field is read-only.
This field shows the value of the variable. To edit a value in UNIX, highlight the cell by clicking on it, press the function key F2 to enter editing mode, and enter the new value. To edit a value in Windows, double click on the cell to highlight it and enter the new value.
The Name, Type, and Value fields are displayed as when using the HELP procedure. For more information about variables, see Variables.
Object references are expanded only if they reference non-null objects. Object data are expanded only if the object method has finished running. Object data are read-only and cannot be changed with the Variable Watch window.
Arrays are expanded to show one array element. Click on the "+" symbol next the name of the array to display the initial array subscript. You can change this field to display the characteristics of any other array element.
| Note |
To edit the subscript, highlight the cell by clicking on it, and modify the name using the arrow keys to maneuver. For example, enter the following:
;Create an array with 2 columns and 3 rows. A=MAKE_ARRAY(2,3) ;Show the values of array A in the Output Log. They will all be ;zero. PRINT, A ;Assign the value of 5 to the value in the array subscripted as 2. ;This is the same as entering A(0,1)=5. A(2)=5 ;Show the new values of array A. PRINT, A
IDL prints:
0.00000 0.00000 5.00000 0.00000 0.00000 0.00000
It is easy to manipulate variables within the Watch window. Click on the "+" expansion symbol next to the array A. The subscript [0,0] will be revealed beneath the description of A. Enter editing mode and change [0,0] to [0,1].
Press Enter to effect the change. Notice that the value of the subscript is displayed as 5, as you entered from the command line. Press the Tab key to highlight the value of the subscript [0,1]. You can change it to another number. Enter [1,0] in the subscript name field. You can also change the value from 0.00000 to another number.
For more information about arrays, see Arrays.