PreviousNextIndex

Class-based method call

Invokes a method of a class. If the method returns a value, the method call can appear anywhere that an expression can appear, and it can also appear as a single statement, ignoring the return value. If the method is VOID (does not return a value), the method call must appear as a single statement.

Syntax

[ { class-type-name | object-reference } : ]  
  method-name ( [ parameter [ , parameter ] ... ] ) [ NO-ERROR ] 

class-type-name
object-reference
method-name
( [ parameter [ , parameter ] ... ] )
NO-ERROR
Examples

The following code fragment shows a call to a public instance method (SetHighCustomerData( )) on an instance of the sample class, r-CustObj:

DEFINE VARIABLE rObj AS CLASS r-CustObj NO-UNDO. 
rObj = NEW r-CustObj( ) NO-ERROR. 
rObj:SetHighCustomerData( ) NO-ERROR. 

This instance method initializes instance data for the class.

The following code fragment shows a call to a public static method (SetHighCustomerData( )) on the sample class type, r-CustObjStatic:

r-CustObjStatic:SetHighCustomerData( ) NO-ERROR. 

This static method initializes class static data without having to instantiate the class, as in the previous instance code.

For more information on these methods 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, METHOD statement, Parameter passing syntax, SUPER system reference, THIS-OBJECT system reference, Type-name syntax


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex