O'Reilly logo

C++ Windows Programming by Stefan Björnander

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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; 
}; 

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required