Class TMemTable (unit MemTbl)

Inherits from

TDataSet

Constructors


constructor Create(AOwner : TComponent);

TMemTable


Functions

destructor Destroy;

Create offset dictionary to store offsets (because TField.

procedure LinkLoad;


function AllocRecordBuffer: PChar;

Required Overrides

procedure FixBindings;


procedure FreeRecordBuffer(var Buffer: PChar);


function GetActiveRecBuf(var RecBuf: PChar): Boolean;


procedure GetBookmarkData(Buffer: PChar; Data: Pointer);


function GetBookmarkFlag(Buffer: PChar): TBookmarkFlag;


function GetFieldData(Field: TField; Buffer: Pointer): Boolean;


function GetLinkDataSource : TDataSource;

property methods

function GetRecNo: Integer;


function GetRecord(Buffer: PChar; GetMode: TGetMode; DoCheck: Boolean): TGetResult;


function GetRecordCount: Integer;

Optional overrides

Optional Methods } { ================


function GetRecordSize: Word;

Record / Field Access } { =====================

procedure InternalAddRecord(Buffer: Pointer; Append: Boolean);


procedure InternalClose;

Create data list

procedure InternalDelete;


procedure InternalFirst;

Record Navigation / Editing } { ===========================

procedure InternalGotoBookmark(Bookmark: Pointer);

Bookmarks } { =========

procedure InternalHandleException;

..Can't use link dataset, Create our field definitions from the fields

procedure InternalInitFieldDefs;


procedure InternalInitRecord(Buffer: PChar);


procedure InternalLast;


procedure InternalLinkLoad;


procedure InternalOpen;

Add up field lengths to get the recordsize

procedure InternalPost;


procedure InternalSetToRecord(Buffer: PChar);


function IsCursorOpen: Boolean;

Reset these internal flags

procedure LinkActiveChanged;


procedure Loaded;

!!.

procedure Notification(AComponent: TComponent; Operation: TOperation);


procedure SetBookmarkData(Buffer: PChar; Data: Pointer);


procedure SetBookmarkFlag(Buffer: PChar; Value: TBookmarkFlag);


procedure SetFieldData(Field: TField; Buffer: Pointer);


procedure SetIndexFieldNames(Value : string);

Copy each field into new record buffer

procedure SetIndexOptions(Value : TIndexOptions);


procedure SetLinkAutoLoad(Value : Boolean);

Check for circular link

procedure SetLinkDataSource(Value : TDataSource);


procedure SetOnIndexCompare(Value : TCompareEvent);


procedure SetRecNo(Value: Integer);


Properties

property Active :

property IndexFieldNames : string read FIndexFieldNames write SetIndexFieldNames; property IndexOptions : TIndexOptions read FIndexOptions write SetIndexOptions; property OnIndexCompare : TCompareEvent read FOnIndexCompare write SetOnIndexCompare;

property AfterCancel :


property AfterClose :


property AfterDelete :


property AfterEdit :


property AfterInsert :


property AfterOpen :


property AfterPost :


property AfterScroll :


property BeforeCancel :


property BeforeClose :


property BeforeDelete :


property BeforeEdit :


property BeforeInsert :


property BeforeOpen :


property BeforePost :


property BeforeScroll :


property Filtered :


property LinkAutoLoad : Boolean


property LinkDataSource : TDataSource


property StartingCapacity : integer


Events

event OnCalcFields :


event OnDeleteError :


event OnEditError :


event OnFilterRecord :


event OnNewRecord :


event OnPostError :


Variables

FCurRec : Integer;


FData : TList;

TDataSet Record handling

FDictionary : TList;


FFieldDefsBorrowed : Boolean;


FIndexFieldNames : string;


FIndexOptions : TIndexOptions;


FLinkAutoLoad : Boolean;


FLinkDataLink : TMemTableLink;


FLinkDataSource : TDataSource;


FLinkLoaded : Boolean;


FOnIndexCompare : TCompareEvent;


FRecBufSize : Integer;


FRecInfoOfs : Integer;


FRecordSize : Integer;


FStartingCapacity : integer;

Property fields


Constructors


constructor Create(AOwner : TComponent);

TMemTable


Functions


destructor Destroy;

Create offset dictionary to store offsets (because TField.Offset is !@$* private)


procedure LinkLoad;


function AllocRecordBuffer: PChar;

Required Overrides


procedure FixBindings;


procedure FreeRecordBuffer(var Buffer: PChar);


function GetActiveRecBuf(var RecBuf: PChar): Boolean;


procedure GetBookmarkData(Buffer: PChar; Data: Pointer);


function GetBookmarkFlag(Buffer: PChar): TBookmarkFlag;


function GetFieldData(Field: TField; Buffer: Pointer): Boolean;


function GetLinkDataSource : TDataSource;

property methods


function GetRecNo: Integer;


function GetRecord(Buffer: PChar; GetMode: TGetMode; DoCheck: Boolean): TGetResult;


function GetRecordCount: Integer;

Optional overrides

Optional Methods } { ================


function GetRecordSize: Word;

Record / Field Access } { =====================


procedure InternalAddRecord(Buffer: Pointer; Append: Boolean);


procedure InternalClose;

Create data list


procedure InternalDelete;


procedure InternalFirst;

Record Navigation / Editing } { ===========================


procedure InternalGotoBookmark(Bookmark: Pointer);

Bookmarks } { =========


procedure InternalHandleException;

..Can't use link dataset, Create our field definitions from the fields


procedure InternalInitFieldDefs;


procedure InternalInitRecord(Buffer: PChar);


procedure InternalLast;


procedure InternalLinkLoad;


procedure InternalOpen;

Add up field lengths to get the recordsize


procedure InternalPost;


procedure InternalSetToRecord(Buffer: PChar);


function IsCursorOpen: Boolean;

Reset these internal flags


procedure LinkActiveChanged;


procedure Loaded;

!!.01


procedure Notification(AComponent: TComponent; Operation: TOperation);


procedure SetBookmarkData(Buffer: PChar; Data: Pointer);


procedure SetBookmarkFlag(Buffer: PChar; Value: TBookmarkFlag);


procedure SetFieldData(Field: TField; Buffer: Pointer);


procedure SetIndexFieldNames(Value : string);

Copy each field into new record buffer


procedure SetIndexOptions(Value : TIndexOptions);


procedure SetLinkAutoLoad(Value : Boolean);

Check for circular link


procedure SetLinkDataSource(Value : TDataSource);


procedure SetOnIndexCompare(Value : TCompareEvent);


procedure SetRecNo(Value: Integer);


Properties


property Active :

property IndexFieldNames : string read FIndexFieldNames write SetIndexFieldNames; property IndexOptions : TIndexOptions read FIndexOptions write SetIndexOptions; property OnIndexCompare : TCompareEvent read FOnIndexCompare write SetOnIndexCompare;


property AfterCancel :


property AfterClose :


property AfterDelete :


property AfterEdit :


property AfterInsert :


property AfterOpen :


property AfterPost :


property AfterScroll :


property BeforeCancel :


property BeforeClose :


property BeforeDelete :


property BeforeEdit :


property BeforeInsert :


property BeforeOpen :


property BeforePost :


property BeforeScroll :


property Filtered :


property LinkAutoLoad : Boolean


property LinkDataSource : TDataSource


property StartingCapacity : integer


Events


event OnCalcFields :


event OnDeleteError :


event OnEditError :


event OnFilterRecord :


event OnNewRecord :


event OnPostError :


Variables


FCurRec : Integer;


FData : TList;

TDataSet Record handling


FDictionary : TList;


FFieldDefsBorrowed : Boolean;


FIndexFieldNames : string;


FIndexOptions : TIndexOptions;


FLinkAutoLoad : Boolean;


FLinkDataLink : TMemTableLink;


FLinkDataSource : TDataSource;


FLinkLoaded : Boolean;


FOnIndexCompare : TCompareEvent;


FRecBufSize : Integer;


FRecInfoOfs : Integer;


FRecordSize : Integer;


FStartingCapacity : integer;

Property fields