Function GetPostValidate() Foundation

Performs data validation after data input to a Get object.

Syntax
GetPostValidate( <oGet> ) --> lValid
Parameters
<oGet>
<oGet> is the get object with input focus. It is identical to the return value of GetActive().
Return

The return value of GetPostValidate() is a logical value which identifies whether a Get object has valid data in its edit buffer. If the value is .F. (false), there is invalid data. Otherwise, the value is .T. (true).

Description

The validation of input data is an essential aspect of applications as it helps to guarantee data integrity. Data validation rules are formulated on the command level by the VALID or RANGE option of the @...GET command or are defined in the form of a code block which is stored in the instance variableoGet:postBlock.

This code block is evaluated by GetPostValidate(). The actual Get object is passed to it and it must return a logical value. The return value of the code block becomes the return value of GetPostValidate(). If no validation rule or code block is defined, or if the Get object does not have input focus, the function returns .T. (true).

When GetPostValidate() returns the value .F. (indicating invalid data is in the Get's edit buffer), the active Get object does not lose input focus. The Get can be exited when it contains valid data. GetPostValidate() is called automatically in the default Get system when a Get object needs to relinquish focus and its edit buffer contents have changed.

In the default Get system, the call to GetPostValidate() occurs in the function GetReader() or GetEventReader().

Examples
GetPostValidate() notes
// The function GetPostValidate() should only be used when a 
// user-defined Get reader is implemented. 
// See GetReader() for an example. 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.