dc_frshort()

Converts a short integer variable to a string for display in a field

Call
#include <vv_short.h>
int dc_frshort(stp, datap, dfldp, cvbufp)

UCHAR *stp

Pointer to a string buffer

PTR *datap Pointer to data variable containing a short integer
DFIELDPTR dfldp Pointer to a data field structure
PTR *cvbufp Pointer to a data conversion buffer
Returns  
1 The short integer value was successfully converted to a string
0 The string exists, but it is too long to fit in the field
Description

dc_frshort() converts the short integer value to string format. If thousands separators are specified (THSEPARATOR is ON for the field), they are inserted as needed. If inserting thousands separators makes the string too long to fit in the field, they are not inserted.

If right justification is set for the field (RTADJUST is ON), then the string is shifted to the right.

The string is checked to ensure that it will fit in the field. If it doesn't, dc_frshort() returns a zero.

If BLANKONZERO is ON and the value is zero, the returned string will only contain protected characters. All zeroes will have been replaced with spaces.

Related Functions

dc_toshort(), vf_short()

Cautions

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

A string that is too long for the field is not considered a fatal error. VV_ERR does not get set; therefore, the VCS error reporting system does not report this condition.


Home Contents Previous Next