This function is used to display and modify variables within the debugger when a Natural object has been interrupted.
For the interrupted Natural object, the Variable
maintenance function displays user-defined variables, global
variables and the database-related system variables
*COUNTER
, *ISN
and
*NUMBER
together with Natural data formats,
lengths and contents.
This section covers the following topics:
This section provides instructions for invoking either the Display Variables (summary) screen with a list of all variables, or the Display Variable (individual) screen with all details on a particular variable.
To display a summary of user-defined, global and database-related system variables
In the Debug Main Menu or in the
Debug Break window, enter function code V
.
Or:
Enter the following direct command:
DISPLAY VARIABLE variable,variable,...
The Display Variables (summary) screen provides a list of the variables specified for the interrupted Natural object. Long values may be displayed truncated on the screen. For arrays, only the contents of the first occurrence are displayed.
To switch between alphanumeric and hexadecimal representation of the variable contents, choose PF10 (Alpha) and PF11 (Hex).
To toggle between the truncated display of a variable and the full name display with the group name, variable name and indices (if relevant), choose PF5 (Zoom).
To display an individual variable in its entirety
From the Display Variables (summary) screen,
select a variable by marking it with the line command
DI
.
Or:
Enter the following direct command:
DISPLAY VARIABLE variable
Or:
On the List Object Source screen, in the
Source column, position the cursor at a variable name and
choose PF18 (Di Va).
The following restrictions apply when using PF18 (Di Va):
If a variable name (including the occurrences of an array)
spans more than one line, only the contents of the first line are evaluated.
If the index of an array is constant, for example, array
(3,2,6), only this occurrence is displayed.
If the index of an array is variable, for example, array
(i,j) or array (3:i), the entire array is displayed.
The Display Variable (individual) screen appears with all relevant specifications for the particular variable.
For large variables that exceed the length of 256 bytes, the screen displays the first 256 bytes by default.
To display the entire contents of the variable or navigate within the contents
Choose PF22 to page backward or PF23 to page forward.
Or:
In the Position field, enter a numeric value to
start the display at a particular position.
You can choose PF10 (Alpha) and PF11 (Hex) to switch between alphanumeric and hexadecimal representation of the variable contents.
To display all occurrences of an array using screen functions
From the Display Variables screen, select a
variable by marking it with the line command DI
.
Or:
Choose PF7 (-) and PF8 (+) to page between the
individual occurrences.
To display one or more occurrences of an array using direct commands
Use the following direct command:
DISPLAY VARIABLE variable-name(index-specification)
where variable-name
denotes
the name of the variable, and
index-specification
denotes any of the
following: an index notation, an index range, or asterisk (*) for all
occurrences of a dimension.
Examples:
DISPLAY VARIABLE
ARRAY1(*) |
One-dimensional array:
Displays all occurrences of the one-dimensional array ARRAY1. |
DISPLAY VARIABLE ARRAY1(1)
or
|
One-dimensional array:
Displays the first occurrence of the one-dimensional array ARRAY1. |
DISPLAY VARIABLE
ARRAY2(2,3:4) |
Two-dimensional array:
Displays the second occurrence of the first dimension and the index notation of the second dimension of the two-dimensional array ARRAY2. |
DISPLAY VARIABLE
ARRAY3(1,3:4,*) |
Three-dimensional array:
Displays the first occurrence of the first dimension, the index notation of the second dimension, and all occurrences of the third dimension of the three-dimensional array ARRAY3. |
To display system variables (except database-related system variables)
Enter the following direct command:
SYSVARS
The System Variables screen appears with a limited set of system variables.
For variables of the type Handle, the name of the class of the instance
that the Handle refers to is displayed in alphanumeric representation. If the
class name is not available, the Globally Unique Identifier (GUID) is displayed
instead. If the class was defined within Natural, the class name or GUID is
suffixed with (NAT)
.
The contents of properties of an instance of a class cannot be displayed within the debugger.
This function does not apply to system variables.
This function is used to change the value of user-defined and global variables and the database-related system variables.
To modify the contents of a variable from the Modify Variable screen
Invoke the Modify Variable screen by marking the
variable with the line command MO
.
Or:
On the Display Variable screen, choose
PF5 (Mod).
On the Modify Variable screen, in the Contents field, change the value of the variable.
The new contents must be valid for the Natural data format of the modified variable since the format of a variable cannot be modified within the debugger.
On the Modify Variable screen, you can toggle between alphanumeric and hexadecimal representation of the variable value using PF10 (Alpha) and PF11 (Hex).
To modify the contents of a variable via direct command
Enter the following direct command:
MODIFY VARIABLE variable = new value
A message appears that confirms modification of the variable value.
Note:
The Modify Variables function or the MODIFY VARIABLE
command can be disallowed by Natural Security as described in Components of an Environment Profile in the Natural Security documentation.