vf_time()

Validates the data entered in an F_TIME field

Call
#include <vv_time.h>
int vf_time(stp, picp, dfldp, cvbufp)

UCHAR *stp

Pointer to the string containing the field data

UCHAR *picp Pointer to the picture associated with the string
DFIELDPTR dfldp Pointer to the time field to validate
UCHAR *cvbufp Pointer to conversion buffer
Returns
1 The data is valid for this F_TIME field.
0 The data is invalid for this F_TIME field.
Description

vf_time() validates time data entered into a time field. First, the string entered in the field is reformatted to match the time format string specified in the field structure. If necessary, the string is padded with the time pad character.

vf_time() does several validation checks on the formatted time string. If the data does not pass a validation check, VAL_ERR is set. The form editor will then display the appropriate message. The following table lists the validation checks and the message displayed in the error window if the check fails.

vf_time() checks for: Message:
A proper time in the specified format INV_TIME followed by proper format
A time in the range specified for the field, if any. OUTOFRANGE
The checks for a proper time are:
  • The minutes are >= 0 and <= 59.

  • The seconds are >= 0 and <= 59.

  • If the 12-hour clock is in use, the hour is >= 0 and <= 12.

  • If a 12-hour clock indicator is in the string, it must match the AM_STRING or PM_STRING that is in the array of informational messages found in vv_infomsg.c

  • If 24-hour clock is being used, the hour is >= 0 and <= 23. (Do not specify an AM_STRING or PM_STRING when using 24-hour clock.)

Vermont Views validation messages are defined in vv_valmsg.c.

Related Functions

vf_bool(), vf_ch(), vf_date(), vf_dec(), vf_fill(), vf_double(), vf_int(), vf_long(), vf_req(), vf_st()


Home Contents Previous Next