Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-release > by-pkgid > 6ce6329cd6ad3b36930de46f3738a9e1 > files > 1359

fpc-2.2.0-1mdv2008.1.x86_64.rpm

{$mode objfpc}
{$h+}
program testsdf;

uses DB,sdfdata,sysutils;

Procedure Dotest;

Var
  I,Count : Integer;

begin
  With TSdfDataSet.Create(Nil) do
    try
      Delimiter := #9;
      FileName := 'fpc.ssy';
      FirstLineAsSchema := False;
      Schema.Add('First Name');
      Schema.Add('Last Name');
      Schema.Add('Email');
      Open;
      Count:=0;
      Try
        While Not EOF do
          begin
          Inc(Count);
          Writeln('Record : ',Count);
          For I:=0 to FieldCount-1 do
            Writeln(Fields[i].FieldName,' : ',Fields[i].AsString);
          Writeln('-------------------------------')  ;
          Next;
          end;
      Finally
        Close;
      end;
    finally
      free;
    end;
end;

begin
  DoTest;
end.