JDE API Essential Part I - MATH_NUMERIC

Purpose of Document

The purpose of this document is to have  simplified version for JDEAPIs.chm file (INTERNAL ONLY). So this document shall only cover APIs which are frequently used in EnterpriseOne business functions.

<Internal_Only>On the way, I shall put in additional information and real-life example for each usages. So please do publish it internally</Internal_Only>

 

 

Data Type in EnterpriseOne
Data Type in C Language
 

MATH_NUMERICEnterpriseOne API (Application Program Interface)
    |--- Common Library
             |--- JdeCurrency
                   |--- ParseNumericStringEx
                   |--- ZeroMathNumericEx
             |--- JdeDate
                   |--- DeformatDate
                   |--- FormatDate
                   |--- IsJDEDATENull
             |--- LinkList
             |--- MATH_NUMERIC
                   |--- Overview
                   |--- FormatMathNumeric
                   |--- IncrementMathNumeric
                   |--- IntToMathNumeric
                   |--- LongToMathNumeric
                   |--- MathAdd
                   |--- MathCompare
                   |--- MathCompareAbsolute
                   |--- MathCopy
                   |--- MathDivide
                   |--- MathNumericToInt
                   |--- MathNumericToLong
                   |--- MathRound
                   |--- MathStringToLong
                   |--- MathSubtract
                   |--- MathZeroTest
                   |--- ParseNumericString
                   |--- ReverseMathNumeric
                   |--- ZeroMathNumeric
             |--- Miscellaneous
                   |--- IsStringBlank
             |--- Data Dictionary
             |--- Imaging
             |--- JDEBASE (To be added into independent document)
             |--- JDE Cache (To be added into additional independent document)
    |--- Events
    |--- System Function

 

EnterpriseOne Data Type (Computation of size in byte):

Data TypeSize in DDActual Size in Byte
Character 1 2
String The size of DD + 1 (='\0') Size in DD x 2
Math Numeric Various 49
Integer 11 4
Pointer (GENLNG) 11 4
Date 6 6
JDEUTIME 11 16

 

 

Data Type in C Language (put down reference here ___________)

SN Type Description
1 Basic Type They are arithmetic types and consists of the two types: (a) integer types and (b) floating-point types.
2 Enumerated types They are again arithmetic types and they are used to define variables that can only be assigned certain discrete integer values throughout the program.
3 Void Type The type specifier void indicates that no value is available.
4 Derived types They include (a) Pointer types, (b) Array types, (c) Structure types, (d) Union types and (e) Function types.
So data type defined in Enterprise follows this

 

Integer Types
Type Storage size Value range
char 1 byte -128 to 127 or 0 to 255
unsigned char 1 byte 0 to 255
signed char 1 byte -128 to 127
int 2 or 4 bytes -32,768 to 32,767 or -2,147,483,648 to 2,147,483,647
unsigned int 2 or 4 bytes 0 to 65,535 or 0 to 4,294,967,295
short 2 bytes -32,768 to 32,767
unsigned short 2 bytes 0 to 65,535
long 4 bytes -2,147,483,648 to 2,147,483,647
unsigned long 4 bytes 0 to 4,294,967,295


Floating-Point Types

Type Storage size Value range Precision
float 4 byte 1.2E-38 to 3.4E+38 6 decimal places
double 8 byte 2.3E-308 to 1.7E+308 15 decimal places
long double 10 byte 3.4E-4932 to 1.1E+4932 19 decimal places



The Void Type

  Types Description
1 Function returns as void There are various functions in C which do not return value or you can say they return void. A function with no return value has the return type as void. For example void exit (int status)
2 Function arguments as void There are various functions in C which do not accept any parameter. A function with no parameter can accept as a void. For example, int rand(void)
3 Pointers to void A pointer of type void * represents the address of an object, but not its type. For example a memory allocation function void *malloc( size_t size ); returns a pointer to void which can be casted to any data type.


Boolean type
The Boolean or logical data type is a data type, having two values (usually denoted true and false), intended to represent the truth values of logic and Boolean algebra. (It is named after George Boole, who first defined an algebraic system of logic in the mid 19th century). The Boolean data type is the primary result of conditional statements, which allow different actions and change control flow depending on whether a programmer-specified boolean condition evaluates to true or false.

C language uses an integer type, where relational expressions like i > j and logical expressions connected by && and || are defined to have value 1 if true and 0 if false, whereas the test parts of if, while, for, etc., treat any non-zero value as true. So in calling API listed below (e.g., MathZeroTest) use it with care.

 

Boolean Integer
TRUE 1
FALSE 0

 

Back To Top

 

SUMMARY

APIFor
MATH_NUMERIC There are no numeric values stored within the OneWorld database. Numeric values are stored as a MATH_NUMERIC data type. A MATH_NUMERIC is a structure that contains all the required information to execute mathematical operations on a stored value. This data type allows the attributes of a number to be stored directly with the value, providing greater flexibility when formatting the number for display.
FormatMathNumeric FormatMathNumeric Formats a JDE MATH_NUMERIC into a fully formatted string, ready for output.
IncrementMathNumeric IncrementMathNumeric Increments or decrements a referenced MATH_NUMERIC by one.
IntToMathNumeric IntToMathNumeric converts an integer to a MATH_NUMERIC.
LongToMathNumeric LongToMathNumeric converts a long to a MATH_NUMERIC.
MathAdd MathAdd adds parameter two to parameter three and returns the sum in parameter one. All parameters are JDE_NUMERIC data types.
MathCompare MathCompare returns a “1” if parameter one is greater than parameter two; returns a “-1” if parameter two is greater than parameter one. Both parameters are JDE_NUMERIC data types
MathCompareAbsolute MathCompareAbsolute is the same as MathCompare, except that it compares the absolute value of the parameters, for example, -123 would be greater than +100.
MathCopy MathCopy copies the value of a source MATH_NUMERIC value (parameter two) to a destination MATH_NUMERIC value (parameter one).
MathDivide MathDivide Divides parameter three by parameter four and places the quotient in parameter one. The remainder is placed in parameter two. All parameters are JDE_NUMERIC data types.
MathNumericToInt MathNumericToInt converts a MATH_NUMERIC into an integer (int). For example, when you pass in 1.9, it is treated as 1.
MathNumericToLong MathNumericToLong converts a MATH_NUMERIC to a long (checks that MATH_NUMERIC does not have decimals).
MathRound MathRound rounds a JDE_NUMERIC passed in parameter two to the specified number of digits passed in parameter three. The result is returned in parameter one.
MathStringToLong MathStringToLong translates a number string into a long number. The value is passed as a return code.
MathSubtract MathSubtract subtracts parameter three from parameter two and places the result into parameter one. All parameters are JDE_NUMERIC data types.
MathZeroTest MathZeroTest returns an int 0 if the string portion of the structure is equal to zero and the length is 1.
ParseNumericString ParseNumericString formats a numeric string into the JDE_NUMERIC format.
ReverseMathNumeric ReverseMathNumeric reverses the sign on a MATH_NUMERIC.
ZeroMathNumeric ZeroMathNumeric sets a MATH_NUMERIC to zero.
IsStringBlank IsStringBlank tests if a given string is blank.
ParseNumericStringEx ParseNumericStringEx is the same as ParseNumericString except it includes the option to keep the Currency Information. Currency Information will not clear if the third parameter is equal to CURRENCY_KEEP.
ZeroMathNumericEx ZeroMathNumericEx is the same as ZeroMathNumeric but with option to keep the Currency Information.Currency Information will not clear if the second parameter is equal to CURRENCY_KEEP.
DeformatDate DeformatDate changes a date string into the JDEDATE format.
FormatDate FormatDate formats an internal JDEDATE into a formatted string.
IsJDEDATENull IsJDEDATENull tests if a JDEDATE is NULL.

 

Overview on MATH_NUMERIC
There are no numeric values stored within the EnterpriseOne database. Numeric values are stored as a MATH_NUMERIC data type. A MATH_NUMERIC is a structure that contains all the required information to execute mathematical operations on a stored value. This data type allows the attributes of a number to be stored directly with the value, providing greater flexibility when formatting the number for display.

Required Header Files
jdemath.h (Including abhvr.h, will indirectly include jdemath.h).

Layout
typedef struct tagMATH_NUMERIC
{
          char String[MAXLEN_MATH_NUMERIC+1];
          char Sign;
          char EditCode;
          short nDecimalPosition;
          short nLength;
} MATH_NUMERIC. FAR *LPMATH_NUMERIC
 

Field Description
String Contains the actual digits of the value stored in this structure, without any formatting characters. For example, 1,234.56 would be represented as a character string 123456.
Sign Specifies whether the stored number is positive or negative.
EditCode Contains the edit that will be performed against the string value before it is displayed.
nDecimalPosition Contains the number of digits that will appear on the right side of the decimal point.
nLength Contains the total length of the number.

MATH_NUMERIC consists of following APIs:

Back To Top

 

FormatMathNumeric
FormatMathNumeric Formats a JDE MATH_NUMERIC into a fully formatted string, ready for output.

Syntax
void FormatMathNumeric (char FAR *,MATH_NUMERIC FAR *);

Parameters

Parameter Note Usage
char FAR* Pointer to output string.  
MATH_NUMERIC FAR* Pointer to Math_Numeric variable.  


Return Value

Return Value Description
None This does not return a value


Example
char szString[MAXLEN_MATH_NUMERIC;
Math_Numeric mnMathNumeric;
ParseNumericString(&mnMathNumeric, “123”);
FormatMathNumeric( szString, &mnMathNumeric);
/* szString will now contain the value “123” */

Note:

Back To Top

 

IncrementMathNumeric
IncrementMathNumeric Increments or decrements a referenced MATH_NUMERIC by one.

Syntax
void IncrementMathNumeric (LPMATH_NUMERIC lpIncremented, int nIncrement);

Parameters

Parameter Note Usage
lpIncremented Pointer to Math_Numeric variable to be incremented.  
nIncrement Flag to indicate if incrementing or decrementing by one. Use a 1 to increment, a -1 to decrement.  


Return Value

Return Value Description
None This does not return a value


Example
MATH_NUMERIC mnMathNumeric;
ParseNumericString( &mnMathNumeric, “123”);
/* Increment a given MATH_NUMERIC by one */
IncrementMathNumeric(&mnMathNumeric, 1);
/* the value of mnMathNumeric is now 124 */
/*Decrement a given MATH_NUMERIC by one * /
IncrementMathNumeric( &mnMathNumeric, -1);
/* the value of mnMathNumeric is now 123 */

Note:

Back To Top

 

IntToMathNumeric
IntToMathNumeric converts an integer to a MATH_NUMERIC.

Syntax
enum MathErrorCode IntToMathNumeric(int nNumberIn, LPMATH_NUMERIC lpmnMathOut);

Parameters

Parameter Note Usage
nNumberIn Integer Input.  
lpmnMathOut Pointer to Math_Numeric variable to be formatted.  


Return Value

Return Value Description
MATH_SUCCESSFUL It was successful
MathErrorCode It was not successful


Example
int nNumber = 200;
MATH_NUMERIC mnMathNumeric;
int nMathReturn;
nMathReturn = IntToMathNumeric(nNumber, &mnMathNumeric);
/*mnMathNumeric should now have the value 200 */

Additional Notes
Currently not ANSI C.

Related APIs:
LongToMathNumeric
MathNumericToInt
MathNumericToLong

Note:

Back To Top

 

LongToMathNumeric
LongToMathNumeric converts a long to a MATH_NUMERIC.

Syntax
enum MathErrorCode IntToMathNumeric(long lNumberIn. LPMATH_NUMERIC lpmnMathOut);

Parameters

Parameter Note Usage
lnumber Long Input.  
lpmnMathOut Pointer to Math_Numeric variable to be formatted.  


Return Value

Return Value Description
MATH_SUCCESSFUL It was successful
MathErrorCode It was not successful


Example
Long lNumber = 23456789L;
MATH_NUMERIC mnMathNumeric;
int nMathReturn;
nMathReturn = LongToMathNumeric(lNumber, &mnMathNumeric);
/* mnMathNumeric should now have the value 23456789 */

Additional Notes
Currently not ANSI C.

Related APIs:
IntToMathNumeric
MathNumericToInt
MathNumericToLong

Note:

Back To Top

 

MathAdd
MathAdd adds parameter two to parameter three and returns the sum in parameter one. All parameters are JDE_NUMERIC data types.

Syntax
enum MathErrorCode MathAdd (LPMATH_NUMERIC lpmnSum. LPMATH_NUMERIC lpmnAddend0. LPMATH_NUMERIC lpmnAddend1);

Parameters

Parameter Note Usage
lpmnSum Pionter to Math_Numeric variable to store result of add  
lpmnAddend0 Pointer to Math_Numeric variable to add  
lpmnAddend1 Pointer to second Math_Numeric variable to add  


Return Value

Return Value Description
MATH_SUCCESSFUL It was successful
MathErrorCode It was not successful


Example
MATH_NUMERIC mnMathOne;
MATH_NUMERIC mnMathTwo;
MATH_NUMERIC mnMathSum;
int nMathReturn;
LongToMathNumeric( 200000L, &mnMathOne);
LongToMathNumeric( 300000L, &mnMathTwo);
nMathReturn = MathAdd( &mnMathSum, &mnMathOne, &mnMathTwo);
/* mnMathSum should now have the value 500000 */

Related APIs:
MathCompare
MathCompareAbsolute
MathCopy
MathDivide
MathMultiply
MathRound
MathSubtract

Note:

Back To Top

 

MathCompare
MathCompare returns a “1” if parameter one is greater than parameter two; returns a “-1” if parameter two is greater than parameter one. Both parameters are JDE_NUMERIC data types.

Syntax
enum MathErrorCode MathCompare (LPMATH_NUMERIC lpmnValue0. LPMATH_NUMERIC 1pmnValue1);

Parameters

Parameter Note Usage
lpmn Pionter to Math_Numeric variable to compare  
lpmnValue1 Pointer to second Math_Numeric variable to compare.  


Return Value

Return Value Description
0 if lpmnValue0 = lpmnValue1
<0 if lpmnValue0 <lpmnValue1
>0 if lpmnValue0> lpmnValue1


Example
MATH_NUMERIC mnMathOne;
MATH_NUMERIC mnMathTwo;
LongToMathNumeric( 200000L, &mnMathOne);
LongToMathNumeric( 300000L, &mnMathTwo);
if ( MathCompareAbsolute( &mnMathOne, &mnMathTwo) = 0 )
{
    /* mnMathOne and mnMathTwo are equal */
}
else
{
    /* mnMathOne and mnMathTwo are not equal */
}

Related APIs:
MathCompare
MathCompareAbsolute
MathCopy
MathDivide
MathMultiply
MathRound
MathSubtract

Note:

Back To Top

 

 

 

MathCopy
MathCopy copies the value of a source MATH_NUMERIC value (parameter two) to a destination MATH_NUMERIC value (parameter one).

Syntax
enum MathErrorCode MathCopy (LPMATH_NUMERIC lpmnDest, LPMATH_NUMERIC lpmnSource);

Parameters

Parameter Note Usage
lpmnDest Pionter to Math_Numeric variable to copy to  
lpmnSour Pointer to second Math_Numeric variable to copy from  


Return Value

Return Value Description
MATH_SUCCESSFUL It was successful
MathErrorCode it was not successful


Example
MATH_NUMERIC mnMathOne;
MATH_NUMERIC mnMathTwo;
int nMathReturn;
ParseNumericString( &mnMathOne. “567”);
nMathReturn = MathCopy( &mnMathtwo, &mnMathOne);
/* mnMathTwo should now have the same values as mnMathOne */

Related APIs:
MathCompare
MathCompareAbsolute
MathCopy
MathDivide
MathMultiply
MathRound
MathSubtract

Note:

Back To Top

 

MathDivide
MathDivide Divides parameter three by parameter four and places the quotient in parameter one. The remainder is placed in parameter two. All parameters are JDE_NUMERIC data types.

Syntax
enum MathErrorCode MathDivide(LPMATH_NUMERIC . LPMATH_NUMERIC, LPMATH_NUMERIC, LPMATH_NUMERIC, int FAR *, int FAR *);

Parameters

 

Parameter Note Usage
LPMATH_NUMERIC Pointer to Math_Numeric variable for the quotient  
LPMATH_NUMERIC Pointer to Math_Numeric variable for the remainder.  
LPMATH_NUMERIC Pointer to Math_Numeric variable to divide.  
LPMATH_NUMERIC Pointer to Math_Numeric variable to divide by.  
FAR* Pointer to the number of decimals to round to.  
FAR* Pointer to the flag indicating whether or not to round: 1 = no; 0 = yes.  


Return Value

Return Value Description
MATH_SUCCESSFUL It was successful
MathErrorCode it was not successful


Example
MATH_NUMERIC mnQuotient;
MATH_NUMERIC mnRemainder;
MATH_NUMERIC mnMathOne;
MATH_NUMERIC mnMathTwo;
int nDecimals = 2;
int nRoundFlag = 1;
ParseNumericString(&mnMathOne. “45”);
ParseNumericString(&mnMathOne. “9”);
nMathReturn = MathDivide(&mnQuotient, &mnRemainder, &mnMathOne,&mnMathTwo, &nDecimals, &nRoundFlag);
/* mnQuotient should be 5.00 */

Related APIs:
MathCompare
MathCompareAbsolute
MathCopy
MathDivide
MathMultiply
MathRound
MathSubtract

Note:

Back To Top

 

MathNumericToInt
MathNumericToInt converts a MATH_NUMERIC into an integer (int). For example, when you pass in 1.9, it is treated as 1.

Syntax
enum MathErrorCode MathNumericToInt(LPMATH_NUMERIC lpmnMathIn, LPINT lpmnNumberOut);

Parameters

Parameter Note Usage
lpmnMathIn Pointer to Math_Numeric variable to input.  
lpmnNumberOut Pointer to integer for output.  


Return Value

Return Value Description
MATH_SUCCESSFUL It was successful
MathErrorCode it was not successful


Example
MATH_NUMERIC mnMathOne;
int nNumber;
int nMathReturn;
nMathReturn = ParseNumericString (&mnMathOne, “487”);
nMathReturn = MathNumericToInt( &mnMathOne, &nNumber);

Related APIs:
IntToMathNumeric
LongToMathNumeric
MathNumericToLong

Note

Back To Top

 

MathRound
MathRound rounds a JDE_NUMERIC passed in parameter two to the specified number of digits passed in parameter three. The result is returned in parameter one.

Syntax
enum MathErrorCode MathRound (LPMATH_NUMERIC lpmnRounded, LPMATH_NUMERIC lpmnMathIn, int FAR * lpnDecimals);

Parameters

Parameter Note Usage
lpmnRounded Pointer to Math_Numeric variable to input.  
lpmnMathIn Pointer to Math_Numeric variable to round  
lpnDecimals Pointer to the number of decimals to round to.  


Return Value

Return Value Description
MATH_SUCCESSFUL It was successful
MathErrorCode it was not successful


Example
MATH_NUMERIC mnMathOne;
Int mnDecimalsToRound;
MATH_NUMERIC mnMathRounded;
int nMathReturn;
ParseNumericString(&mnMathOne. “12.45678”);
nDecimalsToRound = 3;
nMathReturn = MathRound(&mnMathRounded, &mnMathOne, &nDecimalsToRound);
/* mnMathRounded should be 12.457 */

Related APIs:
MathAdd
MathCompare
MathCompareAbsolute
MathCopy
MathDivide
MathMultiply
MathSubtract

Note

Back To Top

 

MathStringToLong
MathStringToLong translates a number string into a long number. The value is passed as a return code.

Syntax
long MathStringToLong (char FAR *s);

Parameters

Parameter Note Usage
FAR*s Math String  


Return Value

Return Value Description
Long number  



Note

Back To Top

 

MathSubtract
MathSubtract subtracts parameter three from parameter two and places the result into parameter one. All parameters are JDE_NUMERIC data types.

Syntax
enum MathErrorCode MathSubtract(LPMATH_NUMERIC lpmnSum, LPMATH_NUMERIC lpmnAddend0, LPMATH_NUMERIC lpmnAddend1);

Parameters

Parameter Note Usage
lpmnSum Pointer to Math_Numeric variable to store result of subtraction.  
lpmnAddend0 Pointer to Math_Numeric variable to subtract from.  
lpmnAddend1 Pointer to Math_Numeric variable to subtract  


Return Value

Return Value Description
MATH_SUCCESSFUL It was successful
MathErrorCode it was not successful


Example
MATH_NUMERIC mnMathOne;
MATH_NUMERIC mnMathTwo;
MATH_NUMERIC mnMathSum;
int nMathReturn;
LongToMathNumberic(400000L, &mnMathOne);
LongToMathNumberic(300000L, &mnMathTwo);
nMathReturn = MathSubtract( &mnMathSum, &mnMathOne, &mnMathTwo);
/* mnMathSum should have the value 100000 */

Related APIs:
MathAdd
MathCompare
MathCompareAbsolute
MathCopy
MathDivide
MathMultiply
MathSubtract

Note

Back To Top

 

MathZeroTest
MathZeroTest returns an int 0 (FALSE) if the string portion of the structure is equal to zero and the length is 1.

Syntax
short MathZeroTest (LPMATH_NUMERIC lpmnValue0);

Parameters

Parameter Note Usage
lpmnValue0 Pointer to Math_Numeric variable to test.  


Return Value

Return Value Description
0 If it is a zero
1 it is not zero


Example
MATH_NUMERIC mnMathOne;
short ReturnCode;
ParseNumericString(&mnMathOne, “0”);
ReturnCode = MathZeroTest(&mnMathOne);

Note: This API may cause you some confusion so keep in mind that it returns 0 when argument is zero

For example, code below,

   if (MathZeroTest(&lpDS->mnAddressNumber))
   {
      MathCopy(&dsD4201500.mnAddressNo, &lpDS->mnAddressNumber);
   }

:In case, mnAddressNumber is Zero then it returns integer value 0 which is FALSE in Boolean so it does not go to MathCopy(&dsD4201500.mnAddressNo, &lpDS->mnAddressNumber);

Back To Top

 

ParseNumericString
ParseNumericString formats a numeric string into the JDE_NUMERIC format.

Syntax
enum MathErrorCode ParseNumericString(LPMATH_NUMERIC lpmnMathOut, LPSTR lpszString);

Parameters

Parameter Note Usage
lpmnMathOut Pointer to Math_Numeric variable to format.  
lpszString Numeric string input.  


Return Value

Return Value Description
MATH_SUCCESSFUL It was successful
MathErrorCode it was not successful


Example
MATH_NUMERIC mnMathOne;
int nMathReturn;
nMathReturn = ParseNumericString (&mnMathOne, “487.98”);

Related APIs:
ParseNumericStringEx

Note

Back To Top

 

ParseNumericStringEx
(This API belongs to JdeCurrency). ParseNumericStringEx is the same as ParseNumericString except it includes the option to keep the Currency Information. Currency Information will not clear if the third parameter is equal to CURRENCY_KEEP.

Syntax
(MathErrorCode) ParseNumericStringEx (MATH_NUMERIC *t, char *s, int iFlag);

Parameters

Parameter Note Usage
*t    
*s    
lflag    


Return Value

Return Value Description
None  


Example
szTaxRate[iPosition] = '\0';
if ( !IsStringBlank (szTaxRate) )
{
    switch ( iTaxPosition )
{
case 0 : jdeMathCopyCurrencyInfo(&mnTaxRate, &(lpDS->mnTaxRate1));
nDecimals = Decimals (&lpDS->mnTaxRate1);
break;
case 1 : jdeMathCopyCurrencyInfo(&mnTaxRate, &(lpDS->mnTaxRate2));
nDecimals = Decimals (&lpDS->mnTaxRate2);
break;
case 2 : jdeMathCopyCurrencyInfo(&mnTaxRate, &(lpDS->mnTaxRate3));
nDecimals = Decimals (&lpDS->mnTaxRate3);
break;
case 3 : jdeMathCopyCurrencyInfo(&mnTaxRate, &(lpDS->mnTaxRate4));
nDecimals = Decimals (&lpDS->mnTaxRate4);
break;
case 4 : jdeMathCopyCurrencyInfo(&mnTaxRate, &(lpDS->mnTaxRate5));
nDecimals = Decimals (&lpDS->mnTaxRate5);
break;
}
ParseNumericStringEx (&mnTaxRate, szTaxRate,CURRENCY_KEEP);
nStringDecimals = Decimals ( &mnTaxRate );
ParseNumericString (&mnThousand, "1000");
MathMultiply ( &mnTaxRate, &mnTaxRate, &mnThousand );
mnTaxRate.nDecimalPosition = (short) nDecimals;
if ( bSign == TRUE )
{
ReverseMathNumeric ( &mnTaxRate );
}
}
else
{
ZeroMathNumeric ( &mnTaxRate );
}

Related APIs:
ParseNumericString

Note

Back To Top

 

ReverseMathNumeric
ReverseMathNumeric reverses the sign on a MATH_NUMERIC.

Syntax
void ReverseMathNumeric (MATH_NUMERIC FAR *pReverse);

Parameters

Parameter Note Usage
pReverse Pointer to Math_Numeric variable to reverse.  


Return Value

Return Value Description
None This code does not return a value


Example
MATH_NUMERIC mnMathOne;
ParseNumericString( &mnMathOne, “1”);
ReverseMathNumeric(&mnMathOne);
/*mnMathOne is now -1 */

Note

Back To Top

 

ZeroMathNumeric
ZeroMathNumeric sets a MATH_NUMERIC to zero.

Syntax
void ZeroMathNumeric (MATH_NUMERIC FAR *pZeroed);

Parameters

Parameter Note Usage
pzeroed Pointer to Math_Numeric variable to set to zero.  


Return Value

Return Value Description
None This does not return a value


Example
MATH_NUMERIC mnMathOne;
ParseNumericString(&mnMathOne, “1”);
ZeroMathNumeric(&mnMathOne);
/*mnMathOne is now 0 */

Related APIs:
ZeroMathNumericEx

Note

Back To Top

 

ZeroMathNumericEx
(This API is grouped in JdeCurrency) ZeroMathNumericEx is the same as ZeroMathNumeric but with option to keep the Currency Information.Currency Information will not clear if the second parameter is equal to CURRENCY_KEEP.

Syntax
(MathErrorCode) ZeroMathNumericEx (MATH_NUMERIC *t, int iFlag);

Parameters

Parameter Note Usage
*t    
iFlag    


Return Value

Return Value Description
None This does not return a value


Related APIs:
ZeroMathNumeric

Note

Back To Top

 

FormatDate
FormatDate formats an internal JDEDATE into a formatted string.

Syntax
Short FormatDate (char FAR *lpszDateStringOut, JDEDATE FAR * lpjdDateIn, char FAR * lpszFormatMask);

Parameters

Parameter Note Usage
lpszDateStringOut Pointer to string buffer for output.  
lpjdDateIn Pointer to JDEDATE in.  
lpszFormatMask Mask indicating format of date output string.  


Return Value

Return Value Description
None This does not return a value


Example
JDEDATE jdDateOne;
char szDateOne[13];
char szFormatMask[ ] = “OSASE”;
JDEDATEToday( &jdDateOne);
rc = FormatDate (szDateOne, &jdDateOne, szFormatMask);

Related APIs:
DeformatDate

Note

Back To Top


 

DeformatDate
DeformatDate changes a date string into the JDEDATE format.

Syntax
Short DeformatDate (JDEDATE FAR * lpjdDateOut, char FAR * lpszDateString, char FAR * lpszFormatMask);

Parameters   

Parameter Note Usage
lpjdDateOut Pointer to JDEDATE variable to format.  
lpszDateString Date string.  
lpszFormatMask Mask indicating format of date output string.  


Return Value

Return Value Description
None This does not return a value


Example
JDEDATE jdDateOne;
char szDateOne[ ] = “03/10/1994\n”;
char szFormatMask[ ] = “OSASE”;
rc = DeformatDate (&jdDateOne, szDateOne, szFormatMask);

Note

Back To Top

IsStringBlank
IsStringBlank tests if a given string is blank.

Syntax
BOOL IsStringBlank( char *pszInputString);

Parameters

Parameter Note Usage
pszInputString Pointer to string to test  


Return Value

Return Value Description
TRUE The string is blank
FALSE The string is not blank


Example
char szString[ ] = “this is not blank”;
If ( IsStringBlank(szString) )
{
/* string is blank */
}
/* string is not blank */
}

Related APIs:
ZeroMathNumeric

Note

Back To Top

 

IsJDEDATENull
IsJDEDATENull tests if a JDEDATE is NULL.

Syntax
BOOL IsJDEDATENull( LPJDEDATE lpjdDate);

Parameters

Parameter Note Usage
lpjdDate Pointer to JDEDATE to test for NULL.  


Return Value

Return Value Description
TRUE The date IS NULL
FALSE The is NOT NULL


Example
JDEDATE jdDateOne;
JDEDATEToday( &jdDateOe);
if ( IsJDEDATENull(&jdDateOne) )
{
/* date is null */
}
else
/* date is not null */
}

Back To Top

 

Note

 

For information on
JDEBASE (To be added into independent document)
JDE Cache (To be added into additional independent document)