Highlighted
Absent Member.
Absent Member.
979 views

[archive] "CREATE" Statement

[Migrated content. Thread originally posted on 31 July 2009]

Generally, we use

          CREATE @Application OF @Excel HANDLE IN EX-APP.


to create an application object. In this instance, we create an Excel object.

and the help document says

CREATE object-name
 
HANDLE { IN } object-handle
       { IS }
Remaining phrases are optional.

SERVER-NAME { IS } server-name
            { =  }
LICENSE-KEY { IS } license-key
            { =  }
EVENT PROCEDURE IS { proc-1 [ {THROUGH} proc-2 ] }
                              {THRU } 
                   { NULL } 



For the above instance, if EXCEL is not installed on the server, "CREATE" will return message like "Class not registered". I would like to catch the error return value, and then I could do error processing when error value returns.

Which parameter or variable does store the error return value?...

I guess "EX-APP" handle does it, but what values are they?...
0 Likes
1 Reply
Highlighted
Absent Member.
Absent Member.

RE: [archive] "CREATE" Statement

An exception is raised that you should handle in the declarative section. For example:


OBJECT-EXCEPTION-HANDLING SECTION.
          USE AFTER EXCEPTION ON OBJECT.
OBJECT-EXCEPTION-HANDLER.
          CALL "C$EXCEPINFO" USING ERROR-INFO, WS-ERR-SOURCE,
                 WS-ERR-DESCRIPTION.
          IF ERROR-INFO-CODE = 340
              ...
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.