Page 1 of 1

Bug in TEncodeFormula.ValueError for ERR_EMPTY_FORMULA

Posted: Wed Feb 27, 2008 8:17 am
by krilbe
Version 3.01.05.

In TEncodeFormula.ValueError, for ERR_EMPTY_FORMULA, the FTokenizer still holds the last formula encoded. The current, empty one, hasn't reached the tokenizer yet. Consequently, the following line will produce a misleading error message:

ErrStr := Format('Error in formula %s' + #13,[FTokenizer.Value]) + ErrStr;

It will say something like:

Error in formula $A$10+$B$10
Empty formula

Rather confusing, since "$A$10+$B$10" is NOT empty.

I think you need either to clear the FTokenizer state so that FTokenizer.Value is empty at this point, or write code for a special case for ERR_EMPTY_FORMULA, so that FTokenizer.Value isn't inserted into the error message.

By the way, you can write 'Error in formula %s'#13 without the + before #13.

Kjell

Posted: Tue Mar 04, 2008 7:36 am
by larsa
Hello

Thank you, I will fix this.


Lars Arvidsson