Property Integer Exit_msg
|Read Access:||Get Exit_msg to IntegerVariable|
|Write Access:||Set Exit_msg to IntegerVariable/Value|
The message (procedure or function) defined by the Exit_msg property is sent whenever the object is about to lose the focus. The default for this property is zero (0), meaning it is not defined as any message.
The property should be set to the id of a "hook" message that is sent to the object about to lose the focus.
Often this function is used to validate the data that a user entered into an object. The message is also used to move any changes that the user made to variables or record buffers.
While returning a non-zero would stop the navigation event, using the exit method event to control navigation is strongly discouraged. These methods should be used only to handle pre-entry or post-exit processing.
Procedure ProcedureName Returns Integer : End_Procedure : Set Exit_msg to (RefProc(ProcedureName))
Function FunctionName Returns Integer : End_Procedure : Set Exit_msg to (RefFunc(FunctionName))
This sample shows how to define a function as Exit_msg. The function checks whether the user has entered a name and pops uo a Stop_Box if not.
Function VerifyData Returns Integer If (Value(Self) = 0) Begin Send Stop_Box "Please enter your name" "Error" End End_Function Set Exit_msg to (RefFunc(VerifyData))
Several objects as a group may all share a common exit message. Delegation to the parent of the objects in the group (often a client) may then allow the objects to use the same code no matter which object has been exited. When common exiting behavior for a class is desired, the exiting message may be used.
You cannot stop an object from losing the focus using a message defined as Exit_msg. You can use Exiting for this.
Exiting | Entry_msg | RefProc function | RefFunc function