# mco_is_object_deleted
RT

> Determine if an object has been deleted within the current transaction.

### Prototype

        MCO_RET mco_is_object_deleted( /*IN*/ MCO_Hf * object_handle );

### Arguments

object_handle | The address of an object handle

### Description

> This function allows an application to determine if an object has been deleted within the current transaction.

### Return Codes

MCO_S_OK | The object has not been deleted
MCO_E_DELETED | The object has been deleted
MCO_E_INVALID_HANDLE | Invalid object handle

### Example

        Application snippet:

        const char * dbname = "SimpleDb";

        int main(int argc, char* argv[])
        {
            mco_db_h db;
            MCO_RET rc;
            mco_device_t       dev;
            mco_db_params_t    db_params;
            mco_trans_h t;
            ...

            if( (rc = mco_runtime_start()) != MCO_S_OK)
                exit(-1);

            rc = mco_db_open_dev( dbname, simpledb_get_dictionary(), &dev, 1, &db_params );
            if ( MCO_S_OK != rc )
            {
                rc = mco_db_connect(  dbname, &db );
                ...
                // Instantiate an object of class A and get its class code
                rc = mco_trans_start(db, MCO_READ_WRITE, MCO_TRANS_FOREGROUND, &t);
                if ( MCO_S_OK == rc ) {
                    A        a;   /* Object handle */
                    uint2 code;
                    rc = A_new ( t, &a );
                    ...
                    rc = mco_is_object_deleted( &a );

                    ...
                    rc = mco_trans_commit( t );
                    ...
                }

            }
        }

### Files

Header file:
mco.h
Source file:
mcoabst.c
Library:
libmcolib.a