PreviousNextIndex

New( ) method

Instantiates a class when class name and any parameters are only known at run time. This method returns a Progress.Lang.Object, which provides an instance of a class. The New( ) method provides similar functionality to the DYNAMIC-NEW function. The advantage to the latter is that it has a fixed, compile-time parameter list and does not require the creation of a Progress.Lang.ParameterList object at run time.

Return type: Progress.Lang.Object class

Access: PUBLIC

Applies to: Progress.Lang.Class class

Two overloaded versions are supported. The first version is used when the constructor of the class does not take any arguments.

Syntax
New( ) 

You can use the second overloaded version of the New( ) method when the constructor of a class takes zero or more parameters. Since a parameterlist-object can be built with zero or more parameters, this version of the New( ) method can be used to instantiate any class, even those classes whose constructor does not take any arguments.

Syntax
New( parameterlist-object ) 

parameterlist-object

The New( ) method allows for I/O blocking.

Notes: Since the New( ) method returns an instance of the Progress.Lang.Object class, the result of the New( ) method must be assigned to a Progress.Lang.Object object .

The New( ) method must be coded as a standalone statement and not part of an ASSIGN statement

See also: Clear( ) method (Class), DYNAMIC-INVOKE function, DYNAMIC-NEW statement, Invoke( ) method (Class), NEW function (classes), NEW statement, NumParameters property, Progress.Lang.ParameterList class, SetParameter( ) method (Class)


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex