class-type-name object-reference : data-member-name [ index ]The name of an ABL or .NET class type that defines the specified data member as a static member. The use of class-type-name to access a static data member is optional when you access the data member from within the class hierarchy where it is defined. For more information, see the notes for this reference entry. You can use class-type-name only to access data members that can be defined as PUBLIC. For more information, see the notes for this reference entry. You cannot use class-type-name to access an instance data member. For more information on specifying class (object) type names, see the Type-name syntax reference entry. You also can use the unqualified class name with the presence of an appropriate USING statement.Specifies a reference to an instance of an ABL or .NET class (an object) that defines the specified data member as an instance member. The use of object-reference to access an instance data member is optional when you access the data member from within the class hierarchy where it is defined. For more information, see the notes for this reference entry.For more information, see the notes for this reference entry. You cannot use object-reference to access a static data member. For information on specifying object references, see the reference entry for a Class-based object reference.[ index ]Specifies the index to reference an element of an ABL array data member, where index is an integer value that identifies the element. The brackets are a required part of the index syntax.
Note: To access the elements of a .NET array object, you must use the .NET SetValue( ) and GetValue( ) methods on the array object instead. For more information on using these methods, see the Microsoft .NET Framework documentation and the Parameter passing syntax reference entry in this manual.The following code fragment shows a reference to a public instance data member (hHighCustData) on an instance of the sample class, r-CustObj:
DEFINE VARIABLE rObj AS CLASS r-CustObj NO-UNDO.rObj = NEW r-CustObj( ) NO-ERROR.
MESSAGE "Number of buffers =" rObj:hHighCustData:NUM-BUFFERSVIEW-AS ALERT-BOX.The following code fragment shows a reference to a public static data member (hHighCustData) on the sample class type, r-CustObjStatic:
MESSAGE "Number of buffers =" r-CustObjStatic:hHighCustData:NUM-BUFFERSVIEW-AS ALERT-BOX.For more information on these data members and the sample classes in which they are defined, see the examples in the CLASS statement reference entry.
Using the appropriate syntax, you can read and write data as defined for the data member type. For more information on the supported ABL data member types, see the reference entry for the CLASS statement and the DEFINE statement for each type of data member.
From within an ABL class definition, you can reference any data member that is both defined and available within the class hierarchy using its data-member-name without a qualifying object-reference (for instance, data members) or class-type-name (for static data members). Data members that you can reference directly by data-member-name within the class hierarchy where they are defined include:
Available variables (and their associated visual widgets) that have a PRIVATE, PROTECTED, or PUBLIC access mode. You can use the THIS-OBJECT system reference as an object-reference to access any available instance variable data member that is defined within the class hierarchy. However, you must use THIS-OBJECT to access any instance variable data member whose name is a reserved keyword. You can also use class-type-name to access any available static variable data member that is defined within the class hierarchy. However, you must use class-type-name to access any static variable data member whose name is a reserved keyword.
From within a class hierarchy where static data members are defined, you can use a qualifying class-type-name to access only the static variable data members from both ABL and .NET, including the elements of arrays. To access all other static data members (such as temp-tables or buffers) defined in the current class hierarchy, you must only use an unqualified data-member-name.
From outside a class hierarchy, you must reference any available instance data member using its data-member-name qualified by an object-reference to the class instance where the data member is defined, and you must reference any available static data member using the class-type-name of the class where the data member is defined as static. The only data members that are available outside the class hierarchy where they are defined are variables defined as PUBLIC (and any associated visual widgets for instance variables), including the elements of arrays.
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |