|
This functionality is a +PxPlus Exclusive |
|||||||||||||
| Invocation: | oHandle
= NEW ( "*plus/obj/wrapup",
program_entry$, param$ FOR { FILE fileno
| WINDOW | PROGRAM | OBJECTobjid
| CONTROL ctlid } ) Where:
|
||||||||||||
| Description | The
"*plus/obj/wrapup.pvc" object
provides a simple means to establish 'Wrapup'
procedures for any program exit, window/file closure or
control/object release. This module allows you to
establish a piece of code to execute or a routine to call
whenever a wrapup related event occurs. You can specify either the name of program/entry point to be called when the wrapup event occurs and an optional parameter to pass to it, or if the program/entry point is empty the system will simply issue an EXECUTE of the parameter field. Whenever the program;entry is called it is passed two parameters. The first is the parameter string that was passed to the object creation when the NEW ( ) function was called. The second parameter is the object identifier of the wrapup object itself. The wrapup object allows the user to add additional properties so you pass additional values to the wrapup routine by simply assigning a value to a property in the wrapup object. The wrapup routine can access these properties using the object ID that will be passed as the 2nd param to the wrapup routine. |
||||||||||||
| Timing of Event | To
have the event occur just prior the
close of a file:
To have the event occur before the current window is closed/dropped:
To have the event occur just before End/Exit/Return from current program:
To have the event occur just before specified object is deleted/dropped:
To have the event occur just before specified control is deleted from the screen:
|
||||||||||||
| Passing additional values | The
wrapup object allows new properties to be dynamically
created in the application. For example, if you wanted to
save the original precision for subsequent restoration in
the wrapup:
This would create a new property in the wrapup object so that in the Wrapup routine the original value could be retrieved using the 2nd parameter passed as in:
|
||||||||||||
| Examples | If
your program needed to set a system parameter, such as
KR, but wanted to make sure it would be reset once the
program was done regardless if the program exited
normally or took and error exit: Using EXECUTE:
When the program exited, the system would then EXECUTE the command to restore the 'KR' setting to its original state. Using a Wrapup routine:
Either of these approaches assures that no matter how the program terminated, the parameter would be reset. |
||||||||||||