CREATE
OBJECT
operand1 OF
[CLASS ]
operand2
|
|
[ON [NODE ] operand4]
|
|
[GIVING
operand3]
|
This document covers the following topics:
For an explanation of the symbols used in the syntax diagram, see Syntax Symbols.
Related Statements: DEFINE
CLASS
| INTERFACE
|
METHOD
|
PROPERTY
|
SEND METHOD
Belongs to Function Group: Component Based Programming
The CREATE OBJECT
statement is used to create an
instance of a class.
When a CREATE OBJECT
statement is executed on
Windows platforms, Natural checks if the name of the class specified in the
statement is registered as a DCOM class. If this is the case, it creates the
object using DCOM. If this is not the case, it searches for a class with that
name in the current Natural library or in the steplibs and creates the object
locally.
Operand Definition Table:
Operand | Possible Structure | Possible Formats | Referencing Permitted | Dynamic Definition | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
operand1
|
S | O | no | no | ||||||||||||||||
operand2
|
C | S | A | yes | no | |||||||||||||||
operand3
|
S | N | I | yes | no | |||||||||||||||
operand4
|
C | S | A | yes | no |
Syntax Element Description:
Syntax Element | Description |
---|---|
operand1
|
Object Handle:
|
OF CLASS
operand2
|
Class-Name:
For further information, see the section Registration with Natural. CREATE OBJECT #O1 OF CLASS "Employee" or CREATE OBJECT #O1 OF CLASS "653BCFE0-84DA-11D0-BEB3-10005A66D231" |
ON NODE
operand4 |
Node:
As If the node clause is specified, an attempt is made to create the object on that node. If the node clause is not specified or contains a blank
value, the object is created on the node that is specified in the system
registry under the key CREATE OBJECT #O1 OF CLASS "Employee" ON NODE "volcano.iceland.com" |
GIVING
operand3
|
GIVING Clause:
If this clause is specified,
If this clause is not specified, Natural run time error processing is triggered if an error occurs. |