ContentsIndexPreviousNext

CREATE Statement

The CREATE statement creates a new instance of an ActiveX or OLE object. Use it specifically for objects that are not ActiveX controls. Use the SCREEN SECTION or Format 14 DISPLAY (DISPLAY control-type-name) to create an instance of an ActiveX control.

General Format

CREATE object-name

Remaining phrases are optional.

SERVER-NAME { IS } server-name
            { =  }
LICENSE-KEY { IS } license-key
            { =  }
HANDLE { IN } object-handle
       { IS }

Syntax Rules

1. Object-name is an optionally qualified name of an ActiveX or OLE object defined in the special-names paragraph.

2. Server-name is an alphanumeric literal or data item.

3. License-key is an alphanumeric literal or data item.

4. Object-handle is a USAGE HANDLE data item.

General Rules

1. Server-name identifies a remote machine on which to create and execute the object. It can be specified as a UNC, DNS name, or IP address.

2. Some ACTIVE-X objects are licensed for run time using a license key that is provided to you by the object vendor. This license key is a text string usually located in a ".lic" file. By setting the value of the LICENSE-KEY property to this license key, you embed this license key in your COBOL program. Then when you run your COBOL program, the license key is passed to the ActiveX object for verification. You do not send the ".lic" file or license key to the end-user. Set LICENSE-KEY when you create the object (i.e., in the CREATE statement). The default value is " ". When LICENSE-KEY is " " (i.e., the default) and the ActiveX object supports the licensing mechanism, the control performs its own license verification. Some objects require a ".lic" file to do this. Others may check the system registry or hard disk for other properly installed and licensed software.