PreviousNextIndex

Class-based property access

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

Syntax

[ [ class-type-name | object-reference ] : ]  
  property-name [ [ index | key ] ] 

class-type-name
object-reference
property-name
[ index | key ]
Examples

The following code fragment shows a reference to a public instance property (HighCustBalance) 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 "High customer balance =" rObj:HighCustBalance  
  VIEW-AS ALERT-BOX. 

Once initialized, this instance property returns the highest balance for all Customer records in the sports2000 database.

The following code fragment shows a reference to a public static property (HighCustBalance) on the sample class type, r-CustObjStatic:

MESSAGE "High customer balance =" r-CustObjStatic:HighCustBalance  
  VIEW-AS ALERT-BOX. 

This static property similarly returns the highest balance for all Customer records in the sports2000 database without having to instantiate the class, as in the previous instance code.

For more information on these properties and the sample classes in which they are defined, see the examples in the CLASS statement reference entry.

Notes
See also

Class-based data member access, Class-based object reference, DEFINE PROPERTY statement, Type-name syntax


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex