2. Language Elements : Variables : Reference Variables : How You Can Create Objects for Reference Variables
 
Share this page                  
How You Can Create Objects for Reference Variables
You may need to create an object for a reference variable. For example, dynamic programs can create fields or forms at runtime by using the Create method, defined for the Class class. The Create method returns an object of a specified class.
In the following example, the reference variable a is declared with a default value of null:
a = Addr default null;
And a new object is created for it:
a = Addr.Create();    /* Creates an Addr object */
a.Street = 'main street';
a.City = 'dallas';
For more information about the Create method, see the Class class Create Method (see Create Method). Examples of using the Create method are provided in "Creating a Frame at Runtime" in the Programming Guide.