vf_req()

Validates fields with the REQUIRED option

Call
#include <vv_form.h>
int vf_req(stp, picp, fldp, cvbufp)

UCHAR *stp

Pointer to string containing the field data

UCHAR *picp Pointer to the picture associated with the string
FIELDPTR fldp Pointer to the data or memo field with the REQUIRED option ON
UCHAR *cvbufp Pointer to conversion buffer
Returns
1 The field passes the REQUIRED field option since at least one character was entered into the field.
0 The field contains all blanks and does not satisfy the REQUIRED field option
Description

vf_req() checks that the REQUIRED field option is satisfied. If there is at least one non-blank, unprotected character in the string, the validation check passes. If the string is all blanks, the test fails.

If the test fails, VAL_ERR is set to REQ_FIELD. The form editor will then display the appropriate message. Vermont Views validation messages are defined in vv_valmsg.c.

Related Functions

vf_bool(), vf_date(), vf_dec(), vf_fill(), vf_double(), vf_int(), vf_long(), vf_time()

Cautions

Protected, non-blank characters in the picture are not considered in checking that the REQUIRED option is fulfilled.


Home Contents Previous Next