Displaying all Variables of an object's class: Difference between revisions
(Created page with "__TOC__ <span class="f_Para">You can display for a given object variable the names and values of the variables defined for its class. </span> <span class="f_Para">For user cl...") |
No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
<span class="f_Para">For any class, the display does </span>''not''<span class="f_Para"> include class methods (Functions, Subroutines, Properties, or Constructors).</span> | <span class="f_Para">For any class, the display does </span>''not''<span class="f_Para"> include class methods (Functions, Subroutines, Properties, or Constructors).</span> | ||
<span class="f_Para">The members you can display for the SOUL system classes are [[ | <span class="f_Para">The members you can display for the SOUL system classes are [[Displaying all Variables of an object's class#Summary of variable members in SOUL system classes|summarized]] below.</span> | ||
<span class="f_Para">The </span><span class="f_Monospace">[[expandObject command|expandObject]]</span><span class="f_Para"> command also invokes this feature, and the </span><span class="f_Monospace">[[getVariablesForClass command|getVariablesForClass]]</span><span class="f_DefListDDTable"> </span><span class="f_Para">command invokes a variant of the feature that retrieves variable names but not values. </span> | <span class="f_Para">The </span><span class="f_Monospace">[[expandObject command|expandObject]]</span><span class="f_Para"> command also invokes this feature, and the </span><span class="f_Monospace">[[getVariablesForClass command|getVariablesForClass]]</span><span class="f_DefListDDTable"> </span><span class="f_Para">command invokes a variant of the feature that retrieves variable names but not values. </span> | ||
Line 14: | Line 14: | ||
# <span class="f_ListNum1">[[Add item to watch window|Add]] the object variable to the </span><var>Watch Window</var><span class="f_ListNum1">. </span> | # <span class="f_ListNum1">[[Add item to watch window|Add]] the object variable to the </span><var>Watch Window</var><span class="f_ListNum1">. </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> | # <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 | :: 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]] | :: [[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 43: | Line 41: | ||
<span class="f_CodeExList">end class cat </span></p> | <span class="f_CodeExList">end class cat </span></p> | ||
: At the same time the Variables are displayed, a [[ | : At the same time the Variables are displayed, a [[Status bar|status bar]] message reports the number of Variables in the class. For this example: <span class="f_Monospace">Found 3 variables in CAT</span><span class="f_ListContinue">. </span> | ||
'''Note:'''<span class="f_Notes"> If the Variables of a class are themselves objects, the only displayable information about their values may be that they are "Not null." </span> | '''Note:'''<span class="f_Notes"> If the Variables of a class are themselves objects, the only displayable information about their values may be that they are "Not null." </span> | ||
: For example, for %d, an instance of a user defined Document class that contains a <var>Janus </var><span class="f_NoteContinue">XmlNode variable and an XmlNodelist variable, the class Variable display is similar to this: </span> | : For example, for %d, an instance of a user defined Document class that contains a <var>Janus </var><span class="f_NoteContinue">XmlNode variable and an XmlNodelist variable, the class Variable display is similar to this: </span> | ||
<p class="syntax">%D: | |||
[[File:classvar3b_zoom60.gif|427x245px|classvar3b]] | x==>Not null XmlDoc | ||
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 === |
Latest revision as of 00:53, 23 May 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 |