Specifications for Picture Validation Functions

A picture validation function must be an integer function that returns TRUE if the picture is valid and FALSE if the picture is invalid. Additionally, if the picture is invalid, you should set the global error code VV_ERR to BADPIC before returning.

A picture validation function must accept three parameters: the first parameter is a pointer to a picture string, the second is a string containing the allowed picture characters for the field type, and the third is an integer containing the picture flags for the field type. The field definition functions will pass these three values.

The complete call for a picture validation functions is as follows:

int picval_func(picp, allowed_picch, flags)
 
UCHAR *picp;    
/* Picture for defined field
*/
UCHAR *allowed_picch;
/* Allowed picture character for field type
*/
int flags;
/* Picture flags for field type
*/

The validation function should check each position in the picture string and perform the validation checks appropriate for the field type.

The picture validation function must check that at least one position in the picture is a picture control character.

The validation function should not contain hard coded characters for the accepted symbols but should reference the appropriate elements in the _dpictbl[ ] array found in vv_main.h.

The contents of the picture string cannot be altered.


Home Contents Previous Next