Product Documentation

VCL/CLX Developers Guide

Previous Topic

Next Topic

Methods

Create

constructor Create();

The constructor for the TCtRecord component.

Destroy

destructor Destroy();

The destructor for the TCtRecord component. Do not call Destroy directly. The object has to be destroyed with the inherited (TObject) Free() method.

Allocate

procedure Allocate(AOwner : TObject);

Allocate a new record buffer. AOwner must be a TCtTable object.

Clear

procedure Clear();

Clear and initialize the record buffer.

Delete

procedure Delete();

Delete the current record.

Duplicate

function Duplicate() : TCtRecord;

Duplicate the current record buffer. The duplicated record buffer shares the same context id of the source record buffer.

EstimateSpan

EstimateSpan(key1 : Pointer; key2 : Pointer) : Integer;

Estimates the number of keys between key1 and key2.

FieldLength

function FieldLength(FieldNumber : Integer) : Integer;

Retrieve the actual field length.

FieldNumber

function FieldNumber(FieldName : String) : Integer;

Retrieve the number of the field given the field name.

FieldSize

function FieldSize(FieldNumber : Integer) : Integer;

Retrieve the declared field size.

Find

function Find(FindMode : CTFIND_MODE) : Boolean;

Find a record. The valid find modes are given in section 4.2. Set target values in the fields that compose the index before calling Find. Find returns TRUE or FALSE, depending on the search result. Only use the mode CTFIND_EQ if the index doesn't allow duplicates.

FindRowid

function FindRowid(ARowid : CTROWID; AFindMode : CTFIND_MODE) : Boolean;

Find a record based on its rowid.

First

function First() : Boolean;

Locate the first record of a table. First returns TRUE if the record is found, FALSE otherwise.

GetFieldAsBigint

function GetFieldAsBigint(FieldNumber : Integer) : Int64;

Retrieve the field data as an Int64 (64 bit) value. The record manager will automatically perform the necessary data type conversion.

GetFieldAsBinary

procedure GetFieldAsBinary(FieldNumber : Integer; var buffer : string);

Retrieve the field data as a binary value. The record manager will automatically perform the necessary data type conversion.

GetFieldAsBoolean

function GetFieldAsBoolean(FieldNumber : Integer) : Boolean;

Retrieve the field data as boolean value. The record manager will automatically perform the necessary data type conversion.

GetFieldAsCurrency

function GetFieldAsCurrency(FieldNumber : Integer) : CTCURRENCY;

Retrieve the field data as a CTCURRENCY (64 bit) value. The record manager will automatically perform the necessary data type conversion.

GetFieldAsDate

function GetFieldAsDate(FieldNumber : Integer) : TDate;

Retrieve the field data as a TDate value. The record manager will automatically perform the necessary data type conversion.

GetFieldAsDateTime

function GetFieldAsDateTime(FieldNumber : Integer) : TDateTime;

Retrieve the field data as a TDateTime value. The record manager will automatically perform the necessary data type conversion.

GetFieldAsFloat

function GetFieldAsFloat(FieldNumber : Integer) : double;

Retrieve the field data as floating point value. The record manager will automatically perform the necessary data type conversion.

GetFieldAsSigned

function GetFieldAsSigned(FieldNumber : Integer) : Integer;

Retrieve the field data as a signed integer value. The record manager will automatically perform the necessary data type conversion.

GetFieldAsString

procedure GetFieldAsString(FieldNumber : Integer; buffer : string);

Retrieve the field data as a string value. The record manager will automatically perform the necessary data type conversion.

GetFieldAsTime

function GetFieldAsTime(FieldNumber : Integer) : TTime;

Retrieve the field data as a TTime value. The record manager will automatically perform the necessary data type conversion.

GetFieldAsUnsigned

function GetFieldAsUnsigned(FieldNumber : Integer) : LongWord;

Retrieve the field data as an unsigned integer value. The record manager will automatically perform the necessary data type conversion.

GetRecordLock

function GetRecordLock() : CTLOCK_MODE;

Retrieve the record lock mode.

GetRowid

function GetRowid() : CTROWID;

Retrieve the record rowid.

IsFieldNull

function IsFieldNull(FieldNumber : Integer) : Boolean;

Determine if the given field is Null.

Last

function Last() : Boolean;

Locate the last record in a table. Last returns TRUE if the record is found, FALSE otherwise.

LockRecord

procedure LockRecord(Mode : CTLOCK_MODE);

Lock the current record. The valid lock modes are given in “c-treeVCL/CLX Definitions”.

Next

function Next() : Boolean;

Locate the next record in a table. Next returns TRUE if the record is found, FALSE otherwise.

NumberOfKeyEntries

NumberOfKeyEntries(IndexNumber : Integer) : Integer;

NumberOfKeyEntries(IndexName : String) : Integer;

Returns the number of entries in the index given by IndexNumber or IndexName.

Prev

function Prev() : Boolean;

Locate the prior record in a table. Prev() returns TRUE if the record is found, FALSE otherwise.

Read

procedure Read();

Re-read the current record.

RecordSetOff

procedure RecordSetOff();

Turn off a record set operation. Record sets are established by a call to RecordSetOn().

RecordSetOn

procedure RecordSetOn(TargetLen : Integer);

Turn on record set operation.

When record set is enabled, the record operations will be substituted by the set operations. This means that, when record set is enabled, operations like First will search for the first record in the set instead of the first record in the entire table.

Just one record set can be enabled for each Record Handle. If you need more than one record set enabled at the same time, you must have more than one Record Handle. To disable and free an existing record set, use RecordSetOff().

Release

procedure Release();

Release all resources associated with a record buffer. Do not call this method for the ActiveRecord() record buffer of a table.

Seek

procedure Seek(Value : CTOFFSET);

Locate a record given its record offset address.

SetFieldAsBigint

procedure SetFieldAsBigint(FieldNumber : Integer; Value : Int64);

Update the field data as an Int64 value. The record manager will automatically perform the necessary data type conversion.

SetFieldAsBinary

procedure SetFieldAsBinary(FieldNumber : Integer; var buffer : string);

Update the field data as a binary value. The record manager will automatically perform the necessary data type conversion.

SetFieldAsBoolean

procedure SetFieldAsBoolean(FieldNumber : Integer; Value : Boolean);

Update the field data as a boolean value. The record manager will automatically perform the necessary data type conversion.

SetFieldAsCurrency

procedure SetFieldAsCurrency(FieldNumber : Integer; Value : CTCURRENCY);

Update the field data as a CTCURRENCY value. The record manager will automatically perform the necessary data type conversion.

SetFieldAsDate

procedure SetFieldAsDate(FieldNumber : Integer; Value : TDate);

Update the field data as a TDate value. The record manager will automatically perform the necessary data type conversion.

SetFieldAsDateTime

procedure SetFieldAsDateTime(FieldNumber : Integer; Value : TDateTime);

Update the field data as a TDateTime value. The record manager will automatically perform the necessary data type conversion.

SetFieldAsFloat

procedure SetFieldAsFloat(FieldNumber : Integer ;Value : double);

Update the field data as a floating point value. The record manager will automatically perform the necessary data type conversion.

SetFieldAsSigned

procedure SetFieldAsSigned(FieldNumber : Integer; Value : Integer);

Update the field data as a signed integer value. The record manager will automatically perform the necessary data type conversion.

SetFieldAsString

procedure SetFieldAsString(FieldNumber : Integer; var buffer : string);

Update the field data as a string value. The record manager will automatically perform the necessary data type conversion.

SetFieldAsTime

procedure SetFieldAsTime(FieldNumber : Integer; Value : TTime);

Update the field data as a TTime value. The record manager will automatically perform the necessary data type conversion.

SetFieldAsUnsigned

procedure SetFieldAsUnsigned(FieldNumber : Integer; Value : LongWord);

Update the field data as an unsigned integer value. The record manager will automatically perform the necessary data type conversion.

UnlockRecord

procedure UnlockRecord();

Release the lock for the current record only.

Write

procedure Write();

Update an existing record or add a new record.

TOCIndex