Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

CTResource::Next

Retrieve the next resource stored in a table.

Declaration

CTBOOL CTResource::Next(CTBOOL lock) const;

Description

Retrieves the next resource stored in a table. lock is used to indicate if the resource should be locked, if it is found.

Return

CTResource::Next() returns YES if the first resource was retrieved or NO if first resource does not exist. In case of error, a CTException is thrown.

Example


// read resources with type >= type and number > 0

void DisplayResources(const CTTable& hTable, ULONG type)

{

CTResource* hRes = new CTResource(hTable, type, 0);


try

{

while (hRes->Next())

{

printf("Resource type: %u, number: %u",

hRes->GetType(), hRes->GetNumber());

}

}

catch (CTException &err)

{

printf("Error %d - %s\n", err.GetErrorCode(), err.GetErrorMsg());

}

delete hRes;

}

See Also

CTResource::Add(), CTResource::Delete(), CTResource::Update(), CTResource::First(), CTResource::Find(), CTResource::GetType(), CTResource::SetType(), CTResource::GetNumber(), CTResource::SetNumber(), CTResource::GetName(), CTResource::SetName(), CTResource::GetDataLength(), CTResource::GetData(), CTResource::SetData(), CTResource::Unlock(), CTResource::IsLocked()

TOCIndex