Displaying all Variables of an object's class: Difference between revisions
No edit summary |
No edit summary |
||
Line 15: | Line 15: | ||
# <span class="f_ListNum2">In the </span><var>Watch Window</var><span class="f_ListNum2">, right click </span><span class="f_ListNum1">the object variable. </span> | # <span class="f_ListNum2">In the </span><var>Watch Window</var><span class="f_ListNum2">, right click </span><span class="f_ListNum1">the object variable. </span> | ||
:: If this is indeed an object variable and its value is not null, the </span><var>Expand Object</var><span class="f_ListContinue"> context menu option is enabled. </span> | :: If this is indeed an object variable and its value is not null, the </span><var>Expand Object</var><span class="f_ListContinue"> context menu option is enabled. </span> | ||
:: [[File:classvar4b_zoom60.gif|339x166px|classvar4b]] | |||
:: If the object variable's value is '</span><span class="f_Monospace">Not null'</span><span class="f_ListContinue">, its class name is automatically displayed as well. If the current object variable value is not '</span><span class="f_Monospace">Not null'</span><span class="f_ListContinue">, no class name appears and the </span><var>Expand Object</var><span class="f_ListContinue"> option is not enabled. </span> | :: If the object variable's value is '</span><span class="f_Monospace">Not null'</span><span class="f_ListContinue">, its class name is automatically displayed as well. If the current object variable value is not '</span><span class="f_Monospace">Not null'</span><span class="f_ListContinue">, no class name appears and the </span><var>Expand Object</var><span class="f_ListContinue"> option is not enabled. </span> | ||
: 3. | : 3. Select <var>Expand Object i</var>f the object variable's value is 'Not null'. | ||
:: A | :: A <var>Value</var> window opens, displaying the names and current values of the member variables in the class, for example, a window like the following displays: | ||
:: [[File:classvar2b_zoom60.gif|427x388px|classvar2b]] | |||
::This is the class definition for the variable display above: | |||
<p class="syntax"><span class="f_CodeExList">class cat </span> | <p class="syntax"><span class="f_CodeExList">class cat </span> | ||
Line 50: | Line 48: | ||
x==>Not null XmlDoc | x==>Not null XmlDoc | ||
top==>Not null XmlNode </p> | top==>Not null XmlNode </p> | ||
: [[File:classvar3b_zoom60.gif|427x245px|classvar3b]] | |||
=== Summary of variable members in SOUL system classes === | === Summary of variable members in SOUL system classes === |
Revision as of 16:20, 20 April 2023
You can display for a given object variable the names and values of the variables defined for its class.
For user classes, members defined as Variables are displayed. For system classes, members that are similar to Variables, that is, that take no arguments (certain Functions and Properties) and return simple values (names, counts, positions, etc.), are displayed.
For any class, the display does not include class methods (Functions, Subroutines, Properties, or Constructors).
The members you can display for the SOUL system classes are summarized below.
The expandObject command also invokes this feature, and the getVariablesForClass command invokes a variant of the feature that retrieves variable names but not values.
To display the member variables in the class represented by a particular object variable:
- Add the object variable to the Watch Window.
- In the Watch Window, right click the object variable.
- If this is indeed an object variable and its value is not null, the Expand Object context menu option is enabled.
- If the object variable's value is 'Not null', its class name is automatically displayed as well. If the current object variable value is not 'Not null', no class name appears and the Expand Object option is not enabled.
- 3. Select Expand Object if the object variable's value is 'Not null'.
class cat public variable name is longstring variable type is longstring variable color is longstring constructor new (%iName is longstring) subroutine talk end public constructor new (%iName is longstring) %this:name = %iName end constructor new subroutine talk print %this:name ' says Meow' end subroutine talk end class cat
- At the same time the Variables are displayed, a status bar message reports the number of Variables in the class. For this example: Found 3 variables in CAT.
Note: If the Variables of a class are themselves objects, the only displayable information about their values may be that they are "Not null."
- For example, for %d, an instance of a user defined Document class that contains a Janus XmlNode variable and an XmlNodelist variable, the class Variable display is similar to this:
%D: x==>Not null XmlDoc top==>Not null XmlNode
Summary of variable members in SOUL system classes
If the object variable you expand (as described above) is an instance of a system class, the members that display are summarized in the table below.
Class | Viewable members |
---|---|
Arraylist | Count
LastItem |
CharacterMap | none suitable |
CharacterTranslationException | BytePosition
CharacterPosition Description HexValue Reason |
Dataset | State |
Daemon | AmDaemon
HaveDaemon MasterNumber ParentNumber |
DaemonLost | none suitable |
GetReplyCode
GetReplyText Host Port | |
FastUnloadTask | State |
FloatNamedArraylist | Count
Default UseDefault |
HttpRequest | Fieldcount
Headercount Host Httpversion Maxredirects Page Port Protocol Proxy Timeout Url |
HttpResponse | Code
Content HeaderCount Message StatusLine Success Url |
InvalidBase64Data | Position |
InvalidHexData | Position |
InvalidRegex | Code
Description Position |
JSON | Type
ToString Count |
Ldap | ErrorNumber
ErrorText |
MaxDaemExceeded | none suitable |
NamedArraylist | Count
Default UseDefault |
NoFreeDaemons | none suitable |
RandomNumberGenerator | none suitable |
Record | FileName
LockStrength RecordNumber |
Recordset | IsEmpty
LockStrength |
RecordsetCursor | FileName
LockStrength LoopLockStrength RecordNumber State |
Screen | ActionKey
Columns Rows |
ScreenField | Column
Invisible ItemId Modified Numeric Protected Row Value Width |
Socket | Errinfo('CODE')
Errinfo('SOCKNUM') Errinfo('FUN') Info('REMOTE') Info('STAT') |
SortedRecordset | IsEmpty |
StringTokenizer | AtEnd
CurrentQuoted CurrentToken NotAtEnd String StringLength |
Stringlist | Count
LastItem MaxItemLength |
UnicodeNamedArraylist | Count
Default UseDefault |
UnknownStatistic | Name |
UserStatistics | LoginToString
RequestToString ToString |
XmlDoc |
DefaultURI Encoding InvalidChar Length LocalName Prefix Qname Type URI Value |
XmlNode | DefaultURI
Length LocalName Prefix Qname Type URI Value |
XmlNodelist | Count |