[ [ 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.
The name of a data member you want to access. In .NET, a data member is referred to as a field. A data member is a data element that is defined in, and at, the level of a class definition (as distinct from a local data element that is defined in and at the level of a method definition). If it is an instance data member, a separate copy exists for each instance of its defining class, for as long as the class instance exists. If it is a static data member, only one copy exists for the defining class type for the entire ABL session, regardless if any instance of the class exists. A data member is available either inside or outside of the class hierarchy depending on its access mode.
|
You can also read or write a .NET data member, depending on its definition. For example, if a given .NET data member is defined as a constant, you can only read the defined value of that data member, but you cannot write to it. .NET data members can also be defined with a variable value as read-only. For information on the definition of a .NET data member, see its field entry in Microsoft .NET, Infragistics, or another third-party class library that defines it. For information on how .NET data types map to ABL data types, see the Data types reference entry.
|
|
If you reference an available data member within a static constructor, static method, static property accessor, or as part of another static data member definition that is defined in the same class or class hierarchy as the referenced member (such as referencing a buffer in a static data-source definition), the referenced data member must also be defined as static; attempting to directly reference an instance data member that is defined in the same class or class hierarchy as the referencing static member raises a compile-time error. To reference a buffer for a database table in a static data member definition, you must define and reference an alternate static buffer data member for the table with a compatible access mode.
|
|
If a data member definition includes a reference to another data member defined in the same class, the access mode of the referenced data member must be no less restrictive than the access mode of the data member definition where it is referenced. For example, if a data-source is defined with a PROTECTED access mode, any buffer that it references must be defined as either PROTECTED or PUBLIC.
|
|
You cannot use a class instance that is not equal to the THIS-OBJECT system reference to access a private or protected instance data member that is defined in the same class, even though this data member is defined in the instantiating class definition. In ABL, all private and protected data members are instance based and available only to members of a given instance of the class, including (for static data members) the "static instance" in the ABL session.
|
|
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.
|
|
Streams, work-tables, and widgets, including browses, buttons, frames, images, menus, sub-menus, and rectangles that you define in a class block are not data members. Like triggers, these are class-scoped resources that are privately available for use with both instance and static members within the defining class.
|
|
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.
|