Displaying all Variables of an object's class

From m204wiki
Revision as of 00:53, 23 May 2023 by Ekern (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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:

  1. Add the object variable to the Watch Window.
  2. 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.
classvar4b
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'.
A Value window opens, displaying the names and current values of the member variables in the class, for example, a window like the following displays:
classvar2b
This is the class definition for the variable display above:

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

classvar3b

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
Email 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