Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

Clearing the record buffer

Call CTRecord::Clear() to clear the record buffer. The record buffer is cleared, the full bit flag for all fields are cleared, the new record flag is set to false, the edited record flag is cleared, and the record offset is set to zero.

// clear the record buffer

CTRecord ARecord(ATable);

try

{

ARecord.Clear();

}

catch (CTException &err)

{

printf("Record clear failed with error %d\n", err.GetErrorCode());

}

In This Section

Clearing a field

Previous Topic

Next Topic

Clearing a field

A field can be cleared, and its null field flag set, by calling CTRecord::ClearField() method. Call CTRecord::IsNullField() to check if a field null flag is set.

// if a field 0 is not null, clear the field

if (!ARecord.IsNullField(0))

{

try

{

ARecord.ClearField(0);

}

catch (CTException &err)

{

printf("Clear field failed with error %d\n", err.GetErrorCode());

}

}

TOCIndex