This document covers the following topics:
You can modify a variable in different ways:
You can modify the variable which is shown at the current cursor position in the editor window. In the resulting dialog box, you can also enter the name of another variable to be modified.
To modify the variable at the cursor position
Select the variable in the editor by placing the cursor at any position within the variable name.
Invoke the context menu and choose
.Or:
Press SHIFT+F9.
Or:
When the Debug toolbar is shown, choose the following
toolbar button:
The Modify Variable dialog box appears showing the content of the selected variable. In the case of an array, the node is expanded by default.
To modify the content of the variable, enter the new value in the Value text box.
Note:
For variables which cannot be modified (such as
unmodifiable system variables) the Value text box is
dimmed.
You can also use the Modify Variable dialog box in the following ways:
When you enter the name of another existing variable in the Variable text box, the content of this variable is immediately shown in the dialog box and you can modify it.
In the case of an array, you can modify the occurrences of this array as follows:
The same value can be defined for all occurrences: Select the top-level node and enter the new value.
Each occurrence can be modified separately: Select the required occurrence and enter the new value.
Specific occurrences can be modified at the same
time: Specify the required occurrences in the Variable
text box. For example, when you change #MYVAR(1:6)
to
#MYVAR(2:3)
, only the second and third occurrence is shown in the
dialog box. When you enter a new value, it applies only to these
occurrences.
Variables (and occurrences) which you have modified are indicated in red.
When you activate the Hexadecimal Display check box, the content of the variable is shown in hexadecimal format.
Choose the
button.Your changes are immediately saved when you choose the
button. They are not yet shown the in variables window.To close the dialog box, choose the
button.Your changes are now shown the in variables window.
You can modify a variable listed in the variables window.
It is not possible to modify an entry which can further be expanded (such as a view). This is only possible for the individual variables after the entry has been expanded.
Different colors are used for the entries in the variables window:
Gray
Variables which cannot be modified (such as unmodifiable
system variables) are indicated in gray.
Red
Variables which you have modified are indicated in red.
To modify a variable in the variables window
Select the required tab in the variables window.
Select the required entry.
Invoke the context menu and choose
.The Modify Variable dialog box appears showing the content of the selected variable.
For further information on this dialog box, see Modifying a Variable in the Editor Window.
If you want to watch specific variables, you can add them to the Watch tab of the variables window.
You can add a watchvariable in different ways:
Note:
It is not possible to modify the content of a
watchvariable.
You can define the variable at the current cursor position in the editor window as a watchvariable.
To add a watchvariable to the variables window
Select the variable in the editor by placing the cursor at any position within the variable name.
Invoke the context menu in the editor and choose
.Or:
Press CTRL+SHIFT+T.
Or:
Select the variable in the editor. Use the mouse to drag the
selected variable to the Watch tab of the variables window
and drop it there.
You can add variables from the first tabs of the variables window to the Watch tab of the same window.
To define a variable as a watchvariable
Select the desired variable in the variables window.
Invoke the context menu and choose
.Or:
Press CTRL+SHIFT+T.
The following topics are covered below:
See also Adding a Watchpoint from the Variables Window.
You can define that the variables which are modified during debugging are always visible in the variables window. This is helpful when you debug a program which has more variables than can be displayed in the variables window at the same time. When a variable is modified during debugging which is currently not visible in the variables window, the display of the variables window is scrolled in such a way so that the modified variable is visible.
To switch this feature on an off
Select any tab in the variables window.
Make sure that no entry is selected on the tab (otherwise, the context menu does not show the required command), invoke the context menu and choose
.When this feature is active, a check mark is shown next to this menu command.
When the variables window is active, you can search for a variable on the currently selected tab.
Note:
When a node in the variables window is not expanded, its
content is not considered in the search.
To find a variable
Select the required tab in the variables window.
Press CTRL+F.
Or:
Make sure that no entry is selected on the tab (otherwise,
the context menu does not show the required command), invoke the context menu
and choose .
The Find Variable dialog box appears.
Specify your search criteria:
Option | Description |
---|---|
Find | The string to be found. |
Case sensitive | If this check box is selected, only strings are found that exactly match the entry in the Find text box. If not selected, any combination of upper- and lower-case letters will be found. |
Whole word | If this check box is selected, the search is restricted to whole words only. If not selected, all occurrences of the string will be found. |
Names | When this option button is selected, the string in the Find text box applies to a variable name. |
Contents | When this option button is selected, the string in the Find text box is applies to the contents of a variable. That is: you want to find a variable which contains the specified contents. |
Choose the
button.When a variable which corresponds to the specified criteria can be found on the current tab, its name is highlighted.
Note:
A message is briefly displayed indicating whether the
specified text has been found or not.
To find the next variable with the specified search criteria
Press F3.
Or:
Make sure that no entry is selected on the tab (otherwise,
the context menu does not show the required command), invoke the context menu
and choose .
You can define whether the contents of the variables is shown in alphanumeric or hexadecimal format in the variables window.
To toggle the format
Select the required tab in the variables window.
Make sure that no entry is selected on the tab (otherwise, the context menu does not show the required command), invoke the context menu and choose
.When the value in the Contents column was previously shown in the alphanumeric format, it is now shown in hexadecimal format, and vice versa.
When the hexadecimal format is used, a check mark is shown next to this menu command.
Usually when something changes in Natural Studio, the display is automatically refreshed. In the debugger, this happens when the content of a variable changes. This automatic refresh requires that the corresponding option has been set in the workspace options.
When the automatic refresh has been deactivated in the workspace options and the content of one or more variables changes in the currently selected tab, you have to refresh the display manually in order to see the current values.
There is one exception: Watchvariables are always refreshed automatically, independent of the setting in the workspace options.
To refresh the display manually
Select any tab in the variables window (except the Watch tab).
Press F5.
Or:
Make sure that no entry is selected on the tab (otherwise,
the context menu does not show the required command), invoke the context menu
and choose .
You can either delete selected watchvariables or all watchvariables from the variables window.
To delete a watchvariable
Select the desired watchvariable in the Watch tab of the variables window.
Invoke the context menu and choose
.Or:
Press DEL.
To delete all watchvariables
Make sure that no entry is selected in the Watch tab of the variables window (otherwise, the context menu does not show the required command), invoke the context menu and choose .