PreviousNextIndex

Class-based data member access

References a data member of a class in order to read or write its value.

Syntax

[ [ class-type-name | object-reference ] : ] data-member-name [ [ index ] ] 

class-type-name
object-reference
data-member-name
[ index ]
Examples

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-BUFFERS  
  VIEW-AS ALERT-BOX. 

This instance data member is a handle to a ProDataSet that is used, in this case, to reference the NUM-BUFFERS attribute, which returns the number of buffers in the ProDataSet.

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-BUFFERS  
  VIEW-AS ALERT-BOX. 

This static data member is also a handle to a similar ProDataSet, and example code performs the same function as the previous instance code without having to instantiate a class.

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.

Notes
See also

Class-based object reference, CLASS statement, Type-name syntax


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex