Hi all.
This is a simple question and probably easy to answer me, but I can't find out the solution.
I noted that when I use a control structure (as if then else, for instance), the result has to be in the same type of variable of the result of the else, so how can I change it ?
My problem is: in the following formula, I want to have a result as the percentage y of x, but if x = 0 I want a string as the result of the formula.
Example:
if x <> 0 then
y % x
else
"n. a."
But it doesn't works, because if the first result is a number, Crystal asks for a same type variable in the else part of the control structure.
Anyone can answer me ?
Thanks for helping
Dv
This is a simple question and probably easy to answer me, but I can't find out the solution.
I noted that when I use a control structure (as if then else, for instance), the result has to be in the same type of variable of the result of the else, so how can I change it ?
My problem is: in the following formula, I want to have a result as the percentage y of x, but if x = 0 I want a string as the result of the formula.
Example:
if x <> 0 then
y % x
else
"n. a."
But it doesn't works, because if the first result is a number, Crystal asks for a same type variable in the else part of the control structure.
Anyone can answer me ?
Thanks for helping
Dv