Hi Guys,
I have to a get a value from Two values. If I want to get X I want to get it like Y/Z. There is an issue. If Y and Z are Zero the X value Prints like "#ERROR". If Both the values are Zero I want to get X also as Zero. Can any one provide me a solution on this. Any help will be appreciated.
0
Comments
example:
if n <> 0 and m <> 0
n/m = x
if n= 0 and m <> 0
n/m = 0
if n<>0 and m = 0
division by zero: impossible
if n= 0 and m= 0
zero divided by zero: indefinite (i don't know if it's correct english)
the correct value for you should be ERROR (mathematically talking), but if you want zero if the division errors out, then just do
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
How to write it under Value property of RTC Report?
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
I don't know how to explain you more than this :-k
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
XXXXX.GET;
XXXXX.SETRANGE("Qty",XXXXX."Qty");
DecCost := XXXXX."Cost" * XXXXX."YQuantity";
IF (XXXXX."Qty" <> 0) THEN
DecPrice :=(DecCost/(XXXXX."Qty"))
ELSE
DecPrice := 1;
Can Some one provide me a solution on this. Any Help will be appreciated.
So what does that tell you then? That the IF part of the statement is returning a FALSE, or XXXX.Qty is equal to zero. It's easy to check with the debugger.
May be you need to double check the syntax of your code...
also XXXXX.GET;
isn't getting anything unless it's some setup table
http://msdn.microsoft.com/en-us/library/dd338616.aspx
http://www.BiloBeauty.com
http://www.autismspeaks.org