Hi,
on request form of a report i had to put in some numbers, like a = 10 b = 5. now in code i had to calculate
c := a / b;
But when the peeps put in zeros for a or for b Navision had a division through Zero. Is there another way then:
if (a <> 0) OR (b <> 0) Then begin
c := a /b
end else
c := 0;
They had to put over 20 numbers into the request form, and i dont wanna code 20 times these lines, does anyone know a better way ??
Thank you for helpin me ( and reading my GOOD English <img border="0" title="" alt="[Smile]" src="images/smiles/icon_smile.gif" /> ) )
Ronnie
0
Comments
______________
DivideWithCaution(decimal P_a, decimal P_b): decimal L_result
IF (P_b <> 0) THEN
exit(P_a / P_b);
exit(0);
______________
and call that function wherever you want.
Toni
Mynavision RULEZ <img border="0" title="" alt="[Smile]" src="images/smiles/icon_smile.gif" />