When applied to a widget or object handle, this attribute always returns a handle. This handle is either valid or invalid based on the state of the instantiating procedure. The instantiating procedure for a dynamically created object might no longer be running. In this case, the handle is invalid.
Note: Since you can never be sure of the state of an instantiating procedure, never use this attribute as a chained attribute.
In general, INSTANTIATING-PROCEDURE returns the procedure handle for the procedure in which the DEFINE or CREATE statement is executed. Following are the exceptions:
For a procedure handle or an asynchronous request object handle, INSTANTIATING-PROCEDURE returns the procedure handle for the procedure from which the RUN statement was executed.
For a socket handle created on a socket server after a CONNECT statement, INSTANTIATING-PROCEDURE returns the procedure handle for the procedure in which the socket server connect procedure is defined.
For a temp-table handle that is passed from a client to an AppServer, INSTANTIATING-PROCEDURE returns the procedure handle for the first procedure run on the AppServer.
For a temp-table handle that is received from an AppServer by a client, INSTANTIATING-PROCEDURE returns the procedure handle for the procedure that called the AppServer.
For implicitly created handles, INSTANTIATING-PROCEDURE returns the procedure handle where the implicitly created object is returned (such as the SAX-attributes object in the StartElement callback).
For the COM-SELF system handle, which is not a widget handle, INSTANTIATING-PROCEDURE returns a run-time error.
Although this attribute applies to all widgets and handles, not all system handles are associated with an instantiating procedure and do not return a procedure handle. For these system handles, this attribute returns the Unknown value (?). The following system handles always return the Unknown value (?):