Watching object variables: Difference between revisions
(Created page with "__TOC__ <span class="f_Para">You add a SOUL object variable to the </span><var>Watch Window</var><span class="f_Para"> using either of the ways described Add item to watch w...") |
No edit summary |
||
Line 4: | Line 4: | ||
<span class="f_Para">But for shared objects, class variables within a class definition, and Stringlist and XmlDoc objects, you need to use variations of these techniques. Otherwise, for Stringlist and XmlDoc objects, the Debugger only informs you whether or not the object has content. And for shared objects, the Debugger may fail to "find" the object. </span> | <span class="f_Para">But for shared objects, class variables within a class definition, and Stringlist and XmlDoc objects, you need to use variations of these techniques. Otherwise, for Stringlist and XmlDoc objects, the Debugger only informs you whether or not the object has content. And for shared objects, the Debugger may fail to "find" the object. </span> | ||
<span class="f_Para">Handling shared objects and class variables are described below. Stringlist objects are discussed in [[Watching $lists, Stringlists, and Arraylists|Watching $lists and Stringlists]], and XmlDoc objects are discussed in [[ | <span class="f_Para">Handling shared objects and class variables are described below. Stringlist objects are discussed in [[Watching $lists, Stringlists, and Arraylists|Watching $lists and Stringlists]], and XmlDoc objects are discussed in [[Displaying Janus SOAP XML document objects|Displaying Janus SOAP XML document objects]]. </span> | ||
=== Watching shared objects === | === Watching shared objects === |
Latest revision as of 18:47, 10 January 2023
You add a SOUL object variable to the Watch Window using either of the ways described earlier: right click the line of code in which it's contained and select the Add Watch option, or type its name in the text box above the Watch Window and click the Watch button.
But for shared objects, class variables within a class definition, and Stringlist and XmlDoc objects, you need to use variations of these techniques. Otherwise, for Stringlist and XmlDoc objects, the Debugger only informs you whether or not the object has content. And for shared objects, the Debugger may fail to "find" the object.
Handling shared objects and class variables are described below. Stringlist objects are discussed in Watching $lists and Stringlists, and XmlDoc objects are discussed in Displaying Janus SOAP XML document objects.
The simplest way to add a shared object variable to the Watch Window is to right click its source code line and add it. When you do so, the class name qualifier is automatically added as a prefix for the variable. For example, if the line you select on the Source Code page is:
Print %(tester):sharedPubNum
The variable that appears in the Watch Window is %(tester):sharedPubNum, and you can successfully watch the shared variable's value as you step through the program.
However, if you choose to add the shared variable by first typing its name in the Entity name input box, you must be sure to prefix the variable with its class name, explicitly specifying:
%(tester):sharedPubNum
If you specify only the variable name (%sharedPubNum), the variable is added to the Watch Window as is, with no %(tester) class name prefix. The Debugger does not recognize this as the shared variable in your program, and a "not found" message eventually displays in the Watch Window.
See Also: