DTW_SUBTRACT

AIX HP-UX Linux OS/2 OS/390 OS/400 PTX SUN Win NT
X X X X X X X X X

Purpose

Subtracts one number from the other number.

Format

@DTW_SUBTRACT(number1, number2, precision, result)

@DTW_SUBTRACT(number1, number2, result)

@DTW_rSUBTRACT(number1, number2, precision)

@DTW_rSUBTRACT(number1, number2)

Parameters

Table 72. DTW_SUBTRACT Parameters
Data Type Parameter Use Description
float number1 IN A variable or literal string representing a number from which another number is to be subtracted.
float number2 IN A variable or literal string representing a number.
integer precision IN A variable or literal string representing a positive whole number that specifies the precision of the result. The default is 9.
float result OUT A variable that contains the difference of number1 and number2.

Return Codes

Table 73. DTW_SUBTRACT Return Codes
Return Code Explanation
-1001 The server could not process a Net.Data request to allocate memory.
1001 An input parameter contained a NULL value.
1002 An input parameter contained a string value which consisted of the null-terminating character.
1003 An incorrect number of parameters were passed on a function call.
1005 A parameter passed on a function call, required to be a string variable, was of a different variable type.
1006 A literal string was passed on a function call for a parameter which was required to be an output parameter.
4000 A parameter contains an invalid whole number value.
4001 A parameter contains an invalid number value.
4002 The result of an arithmetic operation had an exponent that was outside the supported range of -999,999,999 to +999,999,999.

Examples

Example 1:

@DTW_SUBTRACT(NUM1, NUM2, comp)
%IF(comp > "0")
<p>$(NUM1) is larger than  $(NUM2).
%ENDIF
 

This example shows a way to compare numeric values, which are strings in Net.Data.

Example 2:

@DTW_SUBTRACT(NUM1, NUM2, result)

Example 3:

@DTW_rSUBTRACT("1.3", NUM2)


[ Top of Page | Previous Page | Next Page | Index ]