Language Reference Guide : System Classes : Class Class : Create Method
 
Share this page          
Create Method
The Create method creates an object of a specified class:
refvariable = Class.Create()
Class
Specifies the system class name of the object you want to create
refvariable
Specifies a reference variable
The Create method returns an object of that class to the refvariable. You must have declared refvariable as the same class before you execute this method. For example, to create an entry field, you must first declare a reference variable of class EntryField:
refvariable = EntryField;
Then you can issue the following statement:
refvariable = EntryField.Create();
The Create method is primarily useful in dynamic applications. In most applications, you only need to declare the reference variable of the particular class, because OpenROAD automatically creates the object associated with a declared reference variable when it initializes the frame or procedure. However, in dynamic applications, you might want to create more than one instance of a particular type of object. For example, you might want to create four entry fields for a new form. Rather than declare four variables of type EntryField, you can declare one and use the Create method and a looping program structure to create the four entry fields.
For an example of this type of dynamic programming, see the Programming Guide.