Business Function compare Data Structure member Value vs Pointer

MarshallB

Well Known Member
Hello,
I want to compare the values of a math numeric data structure member in a business function,(this is within BSFN B4201070 FYI).
What I want is:
if((lpDS->mnUnitsTransactionQty) != (lpDS->mnUnitsQuantityShipped));
{
//Do Someting
else
//Do Something else
}
When I attempt to build the above I get an "error C2088: '!=':illegal for struct" (thats true for any operator '<','>' etc...not just !=).
Again, I want to compare the values, not the pointer reference. I just don't have a good enough understanding to format this properly.
For example in my case UnitsTransactionQuantity = 10 UnitsQuantityShipped = 5.
Thanks for any suggestions.

Marshall Baird
E1 9.1 tools 9.1.0.3
Windows 7 64 bit
SQL 2008 R2
 

craig_welton

Legendary Poster
Since a MATH_NUMERIC is a JDE specific datatype, you use the API MathCompare.

MathCompare (LPMATH_NUMERIC lpmnValue0. LPMATH_NUMERIC 1pmnValue1);

returns:
0 : numbers are equal
1 : number 1 is greater
-1 : number 2 is greater

In your example:
<font class="small">Code:</font><hr /><pre>if(MathCompare(&lpDS->mnUnitsTransactionQty, &lpDS->mnUnitsQuantityShipped) != 0)
{
//Not Equal Do Someting
}
else
{
// Equal Do Something else
}
</pre><hr />
 

MarshallB

Well Known Member
While I'm at it, is there a place to find a list of these API's? I've done some googling related to this thread, but without much success.
Thanks
 

Remo Williams

VIP Member
You can download the "EnterpriseOne 8.9x Tools API Reference" from Oracle. See attachment to get an idea of what it looks like.
 

Attachments

  • 179391-JDEAPIs.jpg
    179391-JDEAPIs.jpg
    468.4 KB · Views: 131

BOster

Legendary Poster
One quick note. I keep the API help file open just about all the time, however, it only documents a small fraction of the available APIs. However, you can usually find a call in an API "family", then find it in the system .h files and find other, non documented API.

For example, you can find MathAdd in the help file and then once you find MathAdd in jdekproto.h you can find all the other MATH_NUMERIC functions that are NOT documented like:

MathMod
MathPow
MathAcos
....

Why JDE decided to document IntToMathNumeric but not DoubleToMathNumeric is beyond me, but once you know one you can infer or find the others.
 
Top