Quantcast
Channel: JDELIST.com - JD Edwards ERP Forums
Viewing all articles
Browse latest Browse all 8059

C Business Function

$
0
0
I am trying to write C Business Function first time. I have Data Structure in .h

typedef struct tagDSD5501A3A
{
MATH_NUMERIC mnInput1;
MATH_NUMERIC mnInput2;
MATH_NUMERIC mnOutput;
JCHAR cOperator;
JCHAR szErrorId[11];
JCHAR szErrorMessage[81];
} DSD5501A3A, *LPDSD5501A3A;

I just want to build simple calculator. Please Guide how will it work and is strycpy and Mathcpy required for this operation.

This is my main logic I don't know if it is correct.
if(LPDSD5501A3A->cOperator=='+')
{
LPDSD5501A3A->mnOutput=LPDSD5501A3A->mnInput1+LPDSD5501A3A->mnInput2;
}
else if(LPDSD5501A3A->cOperator=='-')
{
LPDSD5501A3A->mnOutput=LPDSD5501A3A->mnInput1-LPDSD5501A3A->mnInput2;
}
else if(LPDSD5501A3A->cOperator=='*')
{
LPDSD5501A3A->mnOutput=LPDSD5501A3A->mnInput1*LPDSD5501A3A->mnInput2;
}
else if(LPDSD5501A3A->cOperator=='/')
{
LPDSD5501A3A->mnOutput=LPDSD5501A3A->mnInput1/LPDSD5501A3A->mnInput2;
}

Viewing all articles
Browse latest Browse all 8059

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>