dc_frtime()

Converts a time variable to a string for display in a field

Call
#include <vv_time.h>
int dc_frtime(stp, datap, dfldp, cvbufp)

UCHAR *stp

Pointer to a string buffer

UCHAR *datap String variable containing string to be converted
DFIELDPTR dfldp Pointer to a data field structure
UCHAR *cvbufp Pointer to a data conversion buffer
Returns  
1 Success. This is the only return value for this function
Description

dc_frtime() prepares a time for display in a field. The time is first reformatted, if necessary, to agree with the field's time format string. The string buffer is then initialized to blanks and the time variable copied to the string buffer. Field requirements are respected as follows:

  • If the field has protected characters, the PICSKIP setting determines how the protected characters are written to the string buffer. If PICSKIP is ON, the protected characters are inserted into the field string at the appropriate positions. If PICSKIP is OFF, the string is written to the buffer first. Any character located in a protected position is overwritten with the protected character.

  • If the field is set for left justification (LFTADJUST is ON), any leading blanks in the string variable are skipped when copying to the string buffer.

  • If the field is set for right justification (RTADJUST is ON) and the string is shorter than the field length, the string is shifted the appropriate number of spaces to the right.

Characters are copied into the string buffer for the length of the field. The variable string will be truncated if there are more characters than fit in the field.

Related Functions

dc_totime(), vf_time()

Cautions

dc_frtime() assumes that the string buffer is large enough to hold the resulting string, including a null terminator '/0'.


Home Contents Previous Next