dc_frst()

Formats a string variable for display in a field

Call
#include <vv_str.h>
int dc_frst(stp, datap, dfldp, cvbufp)

UCHAR *stp

Pointer to a string buffer

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

dc_frst() prepares a string for display in a field. The string buffer is initialized to blanks and the string variable is 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_tost(), vf_st()

Cautions

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


Home Contents Previous Next