I am writing some formulas in crystal reports. I have a field that may contain a numeric value, in which case I am doing some calulation on it, or it may contain a string value, in which case it should be returned verbatim. So I thought this should work: If Result.entry contains a number, then put that numeric value into Result, else just return Result.entry:
Local NumberVar Result := 0;
if NumericText({RESULT.ENTRY}) // may be N.D. or B.L.D.
then
( Result:=val({RESULT.ENTRY});)
else (
{RESULT.ENTRY} );
);
// something more going on here that at last returns some value
But no..."A number is required here" says CR and highlights the block following else... Any clue at all to what Crazy, sorry Crystal Reports wants here and why this is not acceptable? I've even tried to set a value and report that afterwards, (as per Crystal report if then help, how to return a string or variable with formula) but I still get the same error.
else ( 0 );
works - but that is definately not what I want. (the other return value from this function is also a string)