Class TSortList (unit SortList)

Inherits from

TObject

This it the sorted list class

Constructors


constructor Create;

Find best match

Active record number (starting from 1



Functions

procedure Append;

Make table Empty

*OK* Clear record


procedure Cancel;

Save data to memory table

Find the perfect place


procedure Define(var NonIndex,EndMark);

NonIndex = First non-indexed field in the record definition.

procedure Delete;

Start editing data

Append where last was deleted


destructor Destroy;

Prepare empty record

procedure Edit;

Append one record

*OK* Append one record


procedure EmptyTable;

No more records ?

function FindKey(const Values: array of const):boolean;

Cancel editing or appending

Start searching .


procedure First;

Delete this record

*OK* Edit record


procedure Last;

To first record

*OK* To first record


procedure Move(a:integer);

Move one back

*OK* Move one back


procedure Next;

To last record

*OK* To last record


procedure Post;

Move in any direction

*OK* Write record (from vars to table


procedure Prior;

Move one forward

*OK* Move one forward


procedure ClearRecord;

Record fields size (in bytes -> includes index size

*OK* Destroy indexed table


function Find(const s:ShortString):boolean;

Go to nearest record (matching index fields only), return TRUE if exact found

*OK* Make table Empty


function GoToNearest:boolean;

Insert one empty record (before this one

Move Higher


procedure InsertRecord;

Write data to memory

*OK* Cancel editing data


procedure ReadRecord;

Clear all data - empty table

*OK* Move in any direction


procedure WriteRecord;

Read data from memory

*OK* Read record (from table to vars


Properties

property BOF : boolean

Search for a specific record (all key fields have to match

property EOF : boolean

Tried to pass the begining of "File" ?

property RecNo : integer

Number of records in a list

property RecordCount : integer

Tried to pass the end of "File" ?

Events

Variables

FBoF : boolean;

Pointer to data table

FData : TDataPtr;

Pointer to index table

FEoF : boolean;


FIndex : TListDataPtr;

Points to active record

FISize : byte;

at Begining Of File, at End Of File ?

FISize2 : byte;


FPtr : pointer;


FRecNo : integer;

Real table record count

FRecordCount : integer;

Last known maximal record count (allocated memory

FSize : integer;

Size with additional index-length byte (for index comparisson

FSize2 : integer;

Index fields size (in bytes), deleted record mark

MaxRecordCount : integer;

Points to the first variable

Temp : integer;



Constructors


constructor Create;

Find best match

Active record number (starting from 1


Functions


procedure Append;

Make table Empty

*OK* Clear record


procedure Cancel;

Save data to memory table

Find the perfect place


procedure Define(var NonIndex,EndMark);

NonIndex = First non-indexed field in the record definition. If all fields are indexed, send the End-mark field here EndMark = byte (or boolean) end-mark field, put it after the last record field. (doesn't belong to record definition, isn't memorized


procedure Delete;

Start editing data

Append where last was deleted


destructor Destroy;

Prepare empty record


procedure Edit;

Append one record

*OK* Append one record


procedure EmptyTable;

No more records ?


function FindKey(const Values: array of const):boolean;

Cancel editing or appending

Start searching ...


procedure First;

Delete this record

*OK* Edit record


procedure Last;

To first record

*OK* To first record


procedure Move(a:integer);

Move one back

*OK* Move one back


procedure Next;

To last record

*OK* To last record


procedure Post;

Move in any direction

*OK* Write record (from vars to table


procedure Prior;

Move one forward

*OK* Move one forward


procedure ClearRecord;

Record fields size (in bytes -> includes index size

*OK* Destroy indexed table


function Find(const s:ShortString):boolean;

Go to nearest record (matching index fields only), return TRUE if exact found

*OK* Make table Empty


function GoToNearest:boolean;

Insert one empty record (before this one

Move Higher


procedure InsertRecord;

Write data to memory

*OK* Cancel editing data


procedure ReadRecord;

Clear all data - empty table

*OK* Move in any direction


procedure WriteRecord;

Read data from memory

*OK* Read record (from table to vars


Properties


property BOF : boolean

Search for a specific record (all key fields have to match


property EOF : boolean

Tried to pass the begining of "File" ?


property RecNo : integer

Number of records in a list


property RecordCount : integer

Tried to pass the end of "File" ?


Events


Variables


FBoF : boolean;

Pointer to data table


FData : TDataPtr;

Pointer to index table


FEoF : boolean;


FIndex : TListDataPtr;

Points to active record


FISize : byte;

at Begining Of File, at End Of File ?


FISize2 : byte;


FPtr : pointer;


FRecNo : integer;

Real table record count


FRecordCount : integer;

Last known maximal record count (allocated memory


FSize : integer;

Size with additional index-length byte (for index comparisson


FSize2 : integer;

Index fields size (in bytes), deleted record mark


MaxRecordCount : integer;

Points to the first variable


Temp : integer;