Class TXBase (unit XBase)

Inherits from

TComponent

Constructors


Constructor Create(AOwner: TComponent);

Public Declarations


Functions

Procedure AppendBlank;


Destructor Destroy;


Function GetFieldByName(FieldName: String): String;


Function GetFieldByNumber(FieldNum: Integer): String;


Function GetFieldName(FieldNo: Integer): String;


Function GetFieldSize(FieldNo: Integer): Integer;


Function GetFieldType(FieldNo: Integer): TFieldType;


Procedure GotoBOF;


Procedure GotoEOF;


Procedure GotoNext;


Procedure GotoPrev;


Procedure GotoRecord(Recnum: Longint);


Procedure PostChanges;


Procedure PutFieldByName(FieldName, Data: String);


Procedure PutFieldByNumber(FieldNum: Integer; Data: String);


Procedure RefreshRecord;


Function Changing: Boolean;


Function DoDelete: Boolean;


Procedure FillHeaderInfo;


Function GetDeleteStatus: boolean;


Function GetFieldNumberFromName(Text: String): Integer;


Function GetFileName: String;


Function GetMemoData(FieldNo: Longint): String;


Function IsBof: Boolean;


Function IsEof: Boolean;


Function PadLeft(Text: String; Len: Integer): String;


Function PadRight(Text: String; Len: Integer): String;


Procedure ReadARecord;

GetFieldInfo

Procedure SetActive(Val: Boolean);


Procedure SetDeleteStatus(Delete: boolean);


Procedure SetFileName(Name: String);


Function TrimSpaces(Text: String): String;


Procedure UpdateFieldData(FieldNo: integer; Text: String);


Procedure UpdateMemoData(FieldNo: integer; Text: String);


Procedure WriteARecord;


Properties

property Active : Boolean


property Bof : Boolean


property Deleted : Boolean


property Eof : Boolean


property FieldCount : Integer


property Filename : String


property Modified : boolean


property Recno : Longint


property RecordCount : Integer


Events

event OnAppended : TNotifyEvent


event OnChanging : TXBChangeEvent


event OnDeleting : TXBDeleteEvent


Variables

DBFile : TFileStream;


DBTHeader : TDBTHeader;


FActive : Boolean;


FCurrentRecord : Longint;


FFileName : String;

Private Declarations

FieldStruct : Array[1..128] Of TFieldStruct;


FModified : Boolean;


FOnAppended : TNotifyEvent;


FOnChanging : TXBChangeEvent;


FOnDeleting : TXBDeleteEvent;


Header : THeader;


IsOpen : Boolean;


MemoFile : TFileStream;


NumFields : Integer;


RecordBuffer : Array[1..4000] Of Char;



Constructors


Constructor Create(AOwner: TComponent);

Public Declarations


Functions


Procedure AppendBlank;


Destructor Destroy;


Function GetFieldByName(FieldName: String): String;


Function GetFieldByNumber(FieldNum: Integer): String;


Function GetFieldName(FieldNo: Integer): String;


Function GetFieldSize(FieldNo: Integer): Integer;


Function GetFieldType(FieldNo: Integer): TFieldType;


Procedure GotoBOF;


Procedure GotoEOF;


Procedure GotoNext;


Procedure GotoPrev;


Procedure GotoRecord(Recnum: Longint);


Procedure PostChanges;


Procedure PutFieldByName(FieldName, Data: String);


Procedure PutFieldByNumber(FieldNum: Integer; Data: String);


Procedure RefreshRecord;


Function Changing: Boolean;


Function DoDelete: Boolean;


Procedure FillHeaderInfo;


Function GetDeleteStatus: boolean;


Function GetFieldNumberFromName(Text: String): Integer;


Function GetFileName: String;


Function GetMemoData(FieldNo: Longint): String;


Function IsBof: Boolean;


Function IsEof: Boolean;


Function PadLeft(Text: String; Len: Integer): String;


Function PadRight(Text: String; Len: Integer): String;


Procedure ReadARecord;

GetFieldInfo


Procedure SetActive(Val: Boolean);


Procedure SetDeleteStatus(Delete: boolean);


Procedure SetFileName(Name: String);


Function TrimSpaces(Text: String): String;


Procedure UpdateFieldData(FieldNo: integer; Text: String);


Procedure UpdateMemoData(FieldNo: integer; Text: String);


Procedure WriteARecord;


Properties


property Active : Boolean


property Bof : Boolean


property Deleted : Boolean


property Eof : Boolean


property FieldCount : Integer


property Filename : String


property Modified : boolean


property Recno : Longint


property RecordCount : Integer


Events


event OnAppended : TNotifyEvent


event OnChanging : TXBChangeEvent


event OnDeleting : TXBDeleteEvent


Variables


DBFile : TFileStream;


DBTHeader : TDBTHeader;


FActive : Boolean;


FCurrentRecord : Longint;


FFileName : String;

Private Declarations


FieldStruct : Array[1..128] Of TFieldStruct;


FModified : Boolean;


FOnAppended : TNotifyEvent;


FOnChanging : TXBChangeEvent;


FOnDeleting : TXBDeleteEvent;


Header : THeader;


IsOpen : Boolean;


MemoFile : TFileStream;


NumFields : Integer;


RecordBuffer : Array[1..4000] Of Char;