Property Integer Entry_msg
|Read Access:||Get Entry_msg to IntegerVariable|
|Write Access:||Set Entry_msg to IntegerVariable/Value|
The message (procedure or function) defined by the Entry_msg property is sent whenever the object is about to receive the focus. The default for this property is zero (0), meaning it is not defined as any message.
If the property is set to anything else, it should be the id of a message that is sent to the object about to receive the focus. If you do not want that object to receive the focus, the function or procedure to which this property is set should return a non-zero value.
Often this message is used to set up an object prior to data entry. For example, an object may be instructed to fill itself with data before the user may interact with it. The entry message is also used to verify whether the user may enter the object.
While returning a non-zero would stop the navigation event, using the entry 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 Entry_msg to (RefProc(ProcedureName))
Function FunctionName Returns Integer : End_Procedure : Set Entry_msg to (RefFunc(FunctionName))
If the message does not return a value, it can be declared without "Returns Integer" on the declaration line.
Procedure SetUpObject set Value to "John Smith" End_Procedure Set Entry_msg to (RefProc(SetUpObject))
This sample shows how to stop entry into an object (e.g. dbForm or other DEO) using a function defined as Entry_msg. The function checks the customer's outstanding balance and returns a non-zero value if the outstanding balance is greater than zero, thus forbidding entry into the object.
Function SetUpObject Returns Integer Integer iRetVal Number nOutStandingBalance Get Value of oCustomerBalance to nOutStandingBalance If (nOutStandingBalance > 0) Begin Send Stop_Box "Customer Id must first pay outstanding balance." "Error" Move 1 to iRetVal End Function_Return iRetVal End_Function Set Entry_msg to (RefFunc(SetUpObject))
Several objects as a group may all share a common entry 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 entered. When common entry behavior for a class is desired, the entering message may be used.
When in the WideList class, the default is msg_Initialize_List.See Also
Entering | Exit_msg | RefProc function | RefFunc function