Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

Record properties

In This Section

New record flag

Edited record flag

Record offset

Record count

Record ROWID

Previous Topic

Next Topic

New record flag

The new record flag indicates if a record has been cleared and not written to disk yet. The record manager uses this flag to decide if a record should be added or updated.

The new record flag is set when the record handle is allocated or when CTRecord::Clear() clears the record. The new record flag is cleared when a record is read from disk by calling one of the CTRecord::First(), CTRecord::Last(), CTRecord::Next(), CTRecord::Prev(), CTRecord::SeekRecord(), CTRecord::Find() or CTRecord::FindTarget() methods.

Use CTRecord::SetNew() to set the record new flag or CTRecord:IsNew() to check if a record is new or not.

Previous Topic

Next Topic

Edited record flag

A record is only written to disk if the edited record flag is set. This flag is set when the record buffer is modified with a call to one of the CTRecord::SetFieldAs...() methods or by calling CTRecord::SetEdited() method. Use CTRecord::IsEdited() to check if a record has been edited or not.

Previous Topic

Next Topic

Record offset

This property holds the current record offset of a record. If a record is cleared, the record offset property is zero. All records in a table, even the first record, will have a record offset value greater than zero.

You can retrieve the record offset value by calling CTRecord::GetRecordPos() method. You can set the record offset property, and load the record data at the offset, by calling CTRecord::SeekRecord().

Previous Topic

Next Topic

Record count

Use CTRecord::GetRecordCount() to retrieve the total number of records in a table. This is a read only property.

// check if table is empty

if (ARecord.GetRecordCount() > 0)

{

printf("Table is not empty\n");

}

Previous Topic

Next Topic

Record ROWID

Use CTRecord::GetRowid() method to retrieve the ROWID value for the current record. This is a read only property.

// retrieve the first record rowid

CTROWID rowid = ARecord.GetRowid();

TOCIndex