mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 21:09:20 +02:00
+ Merged from fixbranch
This commit is contained in:
parent
3aed976417
commit
9a9ee075e5
1264
fcl/db/dbase/Makefile
Normal file
1264
fcl/db/dbase/Makefile
Normal file
File diff suppressed because it is too large
Load Diff
17
fcl/db/dbase/Makefile.fpc
Normal file
17
fcl/db/dbase/Makefile.fpc
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#
|
||||||
|
# Makefile.fpc for interbase.pp units
|
||||||
|
|
||||||
|
[targets]
|
||||||
|
units=dbf
|
||||||
|
examples=testdbf
|
||||||
|
|
||||||
|
[require]
|
||||||
|
options=-S2 -Sh
|
||||||
|
|
||||||
|
[install]
|
||||||
|
unitsubdir=fcl
|
||||||
|
packagename=fcl
|
||||||
|
|
||||||
|
[dirs]
|
||||||
|
fpcdir=../../..
|
||||||
|
targetdir=../../$(OS_TARGET)
|
2896
fcl/db/dbase/dbf.pas
Normal file
2896
fcl/db/dbase/dbf.pas
Normal file
File diff suppressed because it is too large
Load Diff
45
fcl/db/dbase/testdbf.pp
Normal file
45
fcl/db/dbase/testdbf.pp
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
program dumpdb;
|
||||||
|
|
||||||
|
{$i+}
|
||||||
|
|
||||||
|
uses db,dbf,sysutils;
|
||||||
|
|
||||||
|
Procedure DumpTable (Const TN,FN : String);
|
||||||
|
|
||||||
|
Var
|
||||||
|
I,Count : longint;
|
||||||
|
F : Text;
|
||||||
|
Buf : Array[1..1024*4] of byte;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Assign(F,FN);
|
||||||
|
Rewrite(F);
|
||||||
|
SetTextBuf(F,Buf);
|
||||||
|
With TDBF.Create(Nil) do
|
||||||
|
begin
|
||||||
|
TableName:=TN;
|
||||||
|
Open;
|
||||||
|
While not EOF do
|
||||||
|
begin
|
||||||
|
Inc(Count);
|
||||||
|
For I:=0 to FieldCount-1 do
|
||||||
|
With Fields[i] do
|
||||||
|
Writeln(F,FieldName:20,' : ',AsString);
|
||||||
|
Writeln(F,StringOfChar('=',72));
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Writeln(F,'Dumped total of ',Count,' records.');
|
||||||
|
Close(F);
|
||||||
|
end;
|
||||||
|
|
||||||
|
Var i : longint;
|
||||||
|
|
||||||
|
begin
|
||||||
|
If ParamCount<2 then
|
||||||
|
begin
|
||||||
|
Writeln('Usage: dumpdb tablename filename');
|
||||||
|
Halt(1);
|
||||||
|
end;
|
||||||
|
DumpTable(Paramstr(1),Paramstr(2));
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user