title: Crystal report "a number is required here"
body: <p>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:</p>
  
  <pre><code>    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
  </code></pre>
  
  <p>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 <a href="https://stackoverflow.com/questions/19684874/crystal-report-if-then-help-how-to-return-a-string-or-variable-with-formula">Crystal report if then help, how to return a string or variable with formula</a>) but I still get the same error.</p>
  
  <pre><code>else ( 0 );
  </code></pre>
  
  <p>works - but that is definately not what I want. (the other return value from this function is also a string)</p>