OWLNext    7.0
Borland's Object Windows Library for the modern age
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Throwing TXBase Exceptions

After you have created or cloned a TXBase object, you can throw the object in two ways:

  • Use the throw keyword followed by the object name, as follows:
    TXBase xobj("Some exception...");
    throw xobj;
  • Call the exception object's Throw function, as follows:
    TXBase xobj("Some exception...");
    xobj.Throw();
    This last method provides strict type safety when you throw the exception. It also provides a polymorphic interface when throwing the exception, allowing the function that catches a TXBase-derived exception object to treat the object as a TXBase object, regardless of what it actually is.