PreviousNextIndex

NEW statement

Creates an instance of a class (object) using the NEW function and assigns its object reference to an appropriately defined ABL data element. Once assigned, you can use the object reference to access this class instance and its PUBLIC data members, properties, and methods. For more information on object references, see the reference entry for a Class-based object reference:

Syntax

object-reference = new-function [ NO-ERROR ] 

object-reference
new-function
NO-ERROR
Example

The following code fragment shows the definition of a variable that is assigned to the object reference for a new class instance:

DEFINE VARIABLE myCustObj AS CLASS acme.myObjs.CustObj NO-UNDO. 
myCustObj = NEW acme.myObjs.CustObj ( ).  

Notes
See also

Assignment (=) statement, CAST function, Class-based object reference, CLASS statement, DYNAMIC-NEW statement, NEW function (classes), New( ) method, Parameter passing syntax


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex