THIS-PROCEDURE :attribute :methodThe THIS-PROCEDURE handle supports all the attributes of the procedure object handle. For a list of these attributes, see the reference entry for the Procedure object handle in this section.The THIS-PROCEDURE handle supports all the methods of the procedure object handle. For a list of these methods, see the reference entry for the Procedure object handle in this section.The following procedure is designed to run both persistently and non‑persistently. It sets up a query on the Customer table of the Sports2000 database that is selectable by Name or Balance.The procedure uses the THIS-PROCEDURE handle to distinguish between persistent and non‑persistent instances of execution. When r-thispr.p is persistent (THIS-PROCEDURE:PERSISTENT = TRUE), it:
Defines a trigger to delete the procedure when it is terminated. Note that the trigger calls the internal procedure destroy-query, which can be executed by other external procedures to delete r-thispr.p when it is persistent. This destroy-query routine references the THIS-PROCEDURE handle to delete its persistent parent. It also deletes the widget pool that maintains the dynamic window.When r-thispr.p is non‑persistent (THIS-PROCEDURE:PERSISTENT = FALSE), it invokes a WAIT-FOR statement rather than defining a trigger to terminate the procedure. It does not need to create a widget pool or maintain any other persistent context.Note that because both persistent and non‑persistent instances of this procedure use a dynamic window separate from the default window, r-thispr.p assigns the window’s handle to the procedure’s CURRENT-WINDOW attribute. This makes the dynamic window current whether or not the procedure is persistent. However, when the procedure is persistent, the CURRENT-WINDOW attribute keeps the dynamic window current while other procedures execute using different windows. Because the persistent procedure has its own current window, its triggers and internal procedures do not have to reset the current window every time they execute.
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |