dbmnyinit

Description

Prepare a DBMONEY value for calls to dbmnyndigit.

Syntax

RETCODE dbmnyinit(dbproc, mnyptr, trim, negative)
 
DBPROCESS    *dbproc;
DBMONEY       *mnyptr;
int                      trim;
DBBOOL         *negative;

Parameters

dbproc

A pointer to the DBPROCESS structure that provides the connection for a particular front-end/server process. It contains all the information that DB-Library uses to manage communications and data between the front end and the server.

This parameter may be NULL. The DBPROCESS is used as a parameter to an application’s error handler. It also contains information on what language to print error messages in. If a DBPROCESS is not supplied, the default national language is used.

mnyptr

A pointer to the DBMONEY value to be initialized. dbmnyinit changes the value of *mnyptr.

trim

The number of digits to trim from *mnyptr. dbmnyinit removes digits from *mnyptr by dividing it by a power of 10. The value of trim determines what power of 10 is used. trim cannot be less than 0.

negative

A pointer to a DBBOOL variable. If *mnyptr is negative, dbmnyinit makes it positive and sets *negative to “true”.

Returns

SUCCEED or FAIL.

dbmnyinit returns FAIL if mnyptr is NULL, negative is NULL, or trim is less than 0.

Usage

See also

dbconvert, dbmnyndigit