Darryl050597
asked on
Binary Error Record
When runnning the Linklst2.dpr, why does Delphi 1.0 create such a big binary record file eg: the binary file size is
LINKEXP .DTA 51,282 .a.. 02-05-97 7:14:10 pm
from such a small bunch of records (100 records), when using all your default settings in the link list demo?
After making a copy of the above program, I changed the total records to 3000 and the binary file size blew out to >1.5M in size.
Whats happening and why?
How can I limit the binary file to its logical smallest size?
*******************
const
Max = 100; {max records for text file, therefore max linked list size}
Record Structure
type
PMyNode = ^TMyNode;
TMyNode = record
Name : String;
Flight: integer;
Day : String;
Next : PMyNode; {Used to link each field}
end;
sample of the write procedure
procedure TDataForm.CreateNewFile;
var
F: File of TMyNode;
Head: PMyNode;
begin
Head := FirstNode;
System.Assign(F, FileName);
ReWrite(F);
while Head^.Next <> nil do begin
System.Write(F, Head^);
Head := Head^.Next;
end;
Write(F, Head^);
System.Close(F);
end;
*******************
sample dump of the LINKEXP .DTA when viewed from within xtree, showing other data that is most likely not directly related to the record structure but added by delphi.
009640 ·tkUnknown·tkInteger·tkCha r·tkEnumer ation·tkFl oat·tkStri ng·tkSet
009680 ·tkClass·tkMethod··TTypeKi nds······· TOrdType·· ·········· ··otL··S
0096C0 aturdayte·otSWord·otUWord· otSLong··T FloatType· ·········· ···ftSin
009700 gle·ftDouble·ftExtended·ft Comp·ftRea l··TMethod Kind······ ········
009740 mkProcedure·mkFunction··TP ropInfoPro c····PropI nfo·PPropI nfoU···~
009780 ·&·]····A·······U···~·1·&· ]·&·y·&·]· ·y··N···&· ··y······· ····U·\·
0097C0 ·G·Sam771··\··p··\··P··p·B R··8·t··p· Ju·X·····W V····FG··& 2·$·u·Iu
009800 ·^_u·X)·······U·····~·&··· ···v··\··· ·p··\··P·· ·t··x··]·· ··9·t···
009840 ·y·Ju··t·····u·1···#WV·u·· ~···0·FG·< &2=···u·Iu ·^_u······ ····U···
LINKEXP .DTA 51,282 .a.. 02-05-97 7:14:10 pm
from such a small bunch of records (100 records), when using all your default settings in the link list demo?
After making a copy of the above program, I changed the total records to 3000 and the binary file size blew out to >1.5M in size.
Whats happening and why?
How can I limit the binary file to its logical smallest size?
*******************
const
Max = 100; {max records for text file, therefore max linked list size}
Record Structure
type
PMyNode = ^TMyNode;
TMyNode = record
Name : String;
Flight: integer;
Day : String;
Next : PMyNode; {Used to link each field}
end;
sample of the write procedure
procedure TDataForm.CreateNewFile;
var
F: File of TMyNode;
Head: PMyNode;
begin
Head := FirstNode;
System.Assign(F, FileName);
ReWrite(F);
while Head^.Next <> nil do begin
System.Write(F, Head^);
Head := Head^.Next;
end;
Write(F, Head^);
System.Close(F);
end;
*******************
sample dump of the LINKEXP .DTA when viewed from within xtree, showing other data that is most likely not directly related to the record structure but added by delphi.
009640 ·tkUnknown·tkInteger·tkCha
009680 ·tkClass·tkMethod··TTypeKi
0096C0 aturdayte·otSWord·otUWord·
009700 gle·ftDouble·ftExtended·ft
009740 mkProcedure·mkFunction··TP
009780 ·&·]····A·······U···~·1·&·
0097C0 ·G·Sam771··\··p··\··P··p·B
009800 ·^_u·X)·······U·····~·&···
009840 ·y·Ju··t·····u·1···#WV·u··
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.