Product Documentation

c-treeACE V10.0 Update Guide

Previous Topic

Next Topic

c-treeACE VCL Method to Compare Records

To extend c-treeDB support to VCL the ctdbCompareRecord() function was added to the TCtRecord class.

TCtRecord.CompareRecords( TCtRecord )

This method compares the current CTRecord content against the argument record.

TctRecord.CompareRecords() returns CTDBRET_DIFFERENT (4086) when records do not match, else CTDBRET_OK.

Example

// MyTableRec is an extra TCtRecord pointer

void __fastcall TFileIOBase::SaveRecordState(void)

{

MyTableRec2 = MyTable->ActiveRecord->Duplicate();

}


bool __fastcall TFileIOBase::IsRecordAltered(void)

{

MyTable->ActiveRecord->Read(); // re-read current record

if(MyTable->ActiveRecord->CompareRecords(MyTableRec2) == CTDBRET_OK)

{return false;}

else {return true;}

}

TOCIndex