mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 12:05:57 +02:00
* fcl-db/dbase: cosmetic: more file structure annotations, clarify comments
git-svn-id: trunk@24150 -
This commit is contained in:
parent
210434e937
commit
f4f128e1d5
@ -646,7 +646,7 @@ begin
|
|||||||
// init field ptr
|
// init field ptr
|
||||||
lFieldDescPtr := @lFieldDescIII;
|
lFieldDescPtr := @lFieldDescIII;
|
||||||
end;
|
end;
|
||||||
// begin writing fields
|
// begin writing field definitions
|
||||||
FFieldDefs.Clear;
|
FFieldDefs.Clear;
|
||||||
// deleted mark 1 byte
|
// deleted mark 1 byte
|
||||||
lFieldOffset := 1;
|
lFieldOffset := 1;
|
||||||
@ -1083,7 +1083,7 @@ begin
|
|||||||
PChar(pNormal)^ := '*';
|
PChar(pNormal)^ := '*';
|
||||||
WriteRecord(iNormal, pNormal);
|
WriteRecord(iNormal, pNormal);
|
||||||
end else begin
|
end else begin
|
||||||
// Cannot found a record after iDel so iDel must be deleted
|
// Cannot find a record after iDel so iDel must be deleted
|
||||||
dec(iDel);
|
dec(iDel);
|
||||||
break;
|
break;
|
||||||
end;
|
end;
|
||||||
@ -1286,7 +1286,7 @@ begin
|
|||||||
else
|
else
|
||||||
GetMem(pDestBuff, DestDbfFile.RecordSize);
|
GetMem(pDestBuff, DestDbfFile.RecordSize);
|
||||||
|
|
||||||
// let the games begin!
|
// Go through record data:
|
||||||
try
|
try
|
||||||
{$ifdef USE_CACHE}
|
{$ifdef USE_CACHE}
|
||||||
BufferAhead := true;
|
BufferAhead := true;
|
||||||
@ -1297,7 +1297,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
// read record from original dbf
|
// read record from original dbf
|
||||||
ReadRecord(lRecNo, pBuff);
|
ReadRecord(lRecNo, pBuff);
|
||||||
// copy record?
|
// copy record unless (deleted or user wants packing)
|
||||||
if (ansichar(pBuff^) <> '*') or not Pack then
|
if (ansichar(pBuff^) <> '*') or not Pack then
|
||||||
begin
|
begin
|
||||||
// if restructure, initialize dest
|
// if restructure, initialize dest
|
||||||
|
@ -19,20 +19,20 @@ type
|
|||||||
PDbfHdr = ^rDbfHdr;
|
PDbfHdr = ^rDbfHdr;
|
||||||
rDbfHdr = packed record
|
rDbfHdr = packed record
|
||||||
VerDBF : Byte; // 0
|
VerDBF : Byte; // 0
|
||||||
Year : Byte; // 1
|
Year : Byte; // 1 year last updated
|
||||||
Month : Byte; // 2
|
Month : Byte; // 2 month last updated
|
||||||
Day : Byte; // 3
|
Day : Byte; // 3 day last updated
|
||||||
RecordCount : Integer; // 4-7
|
RecordCount : Integer; // 4-7 number of records in file
|
||||||
FullHdrSize : Word; // 8-9
|
FullHdrSize : Word; // 8-9
|
||||||
RecordSize : Word; // 10-11
|
RecordSize : Word; // 10-11 sum of all field sizes, including delete flag
|
||||||
Dummy1 : Word; // 12-13
|
Dummy1 : Word; // 12-13
|
||||||
IncTrans : Byte; // 14
|
IncTrans : Byte; // 14
|
||||||
Encrypt : Byte; // 15
|
Encrypt : Byte; // 15 DBase encryption flag
|
||||||
MultiUse : Integer; // 16-19
|
MultiUse : Integer; // 16-19
|
||||||
LastUserID : Integer; // 20-23
|
LastUserID : Integer; // 20-23
|
||||||
Dummy2 : array[24..27] of Byte;
|
Dummy2 : array[24..27] of Byte;
|
||||||
MDXFlag : Byte; // 28
|
MDXFlag : Byte; // 28
|
||||||
Language : Byte; // 29
|
Language : Byte; // 29 code page mark
|
||||||
Dummy3 : Word; // 30-31
|
Dummy3 : Word; // 30-31
|
||||||
end;
|
end;
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@ -61,7 +61,7 @@ type
|
|||||||
WorkAreaID : Byte; // 20
|
WorkAreaID : Byte; // 20
|
||||||
// WorkAreaID only for DBase III, is always $01
|
// WorkAreaID only for DBase III, is always $01
|
||||||
Reserved2 : array[21..30] of Byte;
|
Reserved2 : array[21..30] of Byte;
|
||||||
MDXIndexField : Byte; //31
|
MDXIndexField : Byte; //31
|
||||||
// DBase IV:
|
// DBase IV:
|
||||||
// $00: no key for this field;
|
// $00: no key for this field;
|
||||||
// $01: key exists for this field in MDX index file
|
// $01: key exists for this field in MDX index file
|
||||||
|
Loading…
Reference in New Issue
Block a user