Error handling
The evaluation errors are as follows:
Missing value: This error occurs when the cell referred in a formula does not hold a value
Reference out of range: This error occurs when a reference is outside the scope of the spreadsheet
Circular reference: This error occurs when a cell is referring to itself, directly or indirectly
Division by zero: This error occurs when the denominator in a division expression is zero
There is also the syntax error that occurs when the user inputs a syntactically incorrect formula.
Error.h
enum ErrorId {SyntaxError, CircularReference, ReferenceOutOfRange, DivisionByZero, MissingValue}; class Error : public exception { public: Error(ErrorId errorId); String ErrorText() const; private: ErrorId errorId; };
Error.cpp
#include "..\\SmallWindows\\SmallWindows.h" #include "Error.h" Error::Error(ErrorId errorId) :errorId(errorId) {...