SetDecimal

PowerBuilder Native Interface

IPB_Session interface:

SetDecimal method

Description

Sets the value of a decimal variable to decimal data in a string.

Syntax

SetDecimal(pbdec dec, LPCTSTR dec_str)

Argument

Description

dec

The decimal data object to be set

dec_str

The string containing the data to be converted to a decimal

Return Values

PBXRESULT. PBX_OK for success.

Examples

This example uses the IPB_Session SetDecimal method to set the value of a variable of type pbdec, then uses the IPB_Value SetDecimal method to set the return value in the PBCallInfo structure:

pbdec pbdecRet = NULL;
LPTSTR lpDecValueToReturn = NULL;

...
pbdecRet = session -> NewDecimal();
session -> SetDecimal( pbdecRet,
    (LPCTSTR)lpDecValueToReturn);
ci -> returnValue -> SetDecimal(pbdecRet);

Usage

If the string contains invalid data, the decimal value is set to 0.0.

See Also