Stream File-IO (SFILEIO) is a component that helps working with 
structured/Binary Database files,
With the ongoing support for tables, binary database was 
forgotten so this is an effort to keep it alive.

This component is a set of procedure will enhance working with 
binary database, Once you assign record
Structure by open procedure you will be able to use all 
different built in-procedure for SFILEIO

One of the very powerful feature of SFILEIO is the ability 
to search on any string field within the record 
without the need for an index, see Tech information.


Technical Information :

 The below listing is the interface section of the Component.
Your record should start with an integer field , this field is used to flag if the record is deleted (-1), and 
Record Zero will have the size of the record stored in this field.

Const

Del = -1;
MaxrecSize = 4096;

type
  TOpenMode = (ofmOpenRead,ofmOpenReadWrite,ofmsharecompat,
               ofmShareExclusive,ofmShareDenyWrite,
               ofmShareDenyRead,ofmShareDenyNone);

  TdisplayWarning = bOOLEAN;

  {TfopenMode = Set of TOpenMode;}

  TSFILEIO = class(Tcomponent)
  private
    Fileio   : TFileStream;
    Fname    : String;
    FrecSize : Integer;
    FrecPtr  : Pointer;
    {Frecord  : TStringList;}
    Tmpss    : Pointer;
    X        : Tstream;
    FopenMode: TopenMode;
    FdispWarning :TdisplayWarning;

    procedure SetCurRec(RecNo: Longint);
    protected
    function GetRecSize: Longint; virtual;
    Constructor Create(Aowner : Tcomponent); Override;
    Destructor Destroy; Override;
    procedure SetLines(Value: TStringList);

  public
    SSlist : TStringList;
    ACtive : Boolean;
    function GetCurRec: Longint;
    function GetNumRecs: Longint;
    Function CloseFile : boolean;
    Function OpenFile(FPtr : Pointer; FSize : Integer) : boolean;
    Function CreateFile(RecSize : Integer) :  boolean;
    function SeekRec(RecNo: Longint; Origin: Word): Longint;
    function WriteRecord( RecNo : Longint): Longint;
    function OpenWrite(FPtr : Pointer; FSize : Integer;RecNo : Longint) : Longint;

    function DeleteRecord( RecNo : Longint): Longint;
    function AppendRecord: Longint;
    function OpenAppend(FPtr : Pointer; FSize : Integer) : Longint;

    function ReadRecord(RecNo : Longint): Longint;
    function openRead(FPtr : Pointer; FSize : Integer;RecNo : Longint) : Boolean;

    Function SearchKey(Skey : String;IPtr : Pointer) : TStringList;
    Function openSearch(FPtr : Pointer;FSize : Integer;Skey : String;IPtr : Pointer) :TStringList;
    Function FindKey(Skey : String;IPtr : Pointer) : Longint;
    Function FindNextKey(Skey : String;IPtr : Pointer) : Longint;
    Function FindPriorKey(Skey : String;IPtr : Pointer) : Longint;

    procedure NextRecord;
    procedure PriorRecord;
    property NumRecs: Longint read GetNumRecs;
    property CurRec: Longint read GetCurRec write SetCurRec;
    Published
    Property FileName : String Read Fname Write Fname;
    {property Recordtype : TStringList read Frecord write SetLines;}
    Property OpenMode : TOpenMode Read FopenMode write FopenMode;
    Property WarningMsg : TdisplayWarning  Read FdispWarning  write FdispWarning;
  end;




CONTACT:


To register this component Please Send $10.00 USD to 

ULTRA SYSTEMS
13158 Pinnacle Ct.
Chino Hills, CA.91709

Once you register you will get the source code and any future updates.
For any bugs , Please Email me at YASSERR@AOL.COM
