[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]

A Commodities Exchange function that acts on a CxObject records errors in
the CxObject's accumulated error field.  The function CxObjError() returns
a CxObject's error field.

    co_errorfield = LONG CxObjError( CxObj *co );

Each bit in the error field corresponds to a specific type of error.  The
following is a list of the currently defined CxObject errors and their
corresponding bit mask constants.


    Error Constant    Meaning
    --------------    -------
    COERR_ISNULL      CxObjError() was passed a NULL.
    COERR_NULLATTACH  Someone tried to attach a NULL CxObject to this
                      CxObject.
    COERR_BADFILTER   This filter CxObject currently has an invalid
                      filter description.
    COERR_BADTYPE     Someone tried to perform a type specific function
                      on the wrong type of CxObject (for example calling
                      SetFilter() on a sender CxObject).


The remaining bits are reserved for future use.  HotKey.c
checks the error field of its filter CxObject to make sure the filter is
valid.  HotKey.c does not need to check the other objects with
CxObjError() because it already makes sure that these other objects are
not NULL, which is the only other kind of error the other objects can
cause in this situation.

Commodities Exchange has a function that clears a CxObject's accumulated
error field, ClearCxObjError().

    void ClearCxObjError( CxObj *co );

A commodity should be careful about using this, especially on a filter.
If a commodity clears a filter's error field and the COERR_BADFILTER bit
is set, Commodities Exchange will think that the filter is OK and start
sending messages through it.


[Back to Amiga Developer Docs]