I got involved in a problem, a little while ago, where Date arithmetic was not working correctly (not D4 - D5). It turned out one of the TDateTime values was being read incorrectly.
 
I found that reading the date directly resulted in it being wrong (1 month off I think) but assigning it to an intermediate variable produced a correct result.
 
I can't remember how the problem was resolved.
 
Max
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Steve Galyer
Sent: Wednesday, 20 October 1999 09:08
To: Multiple recipients of list delphi
Subject: [DUG]: D4 vs D5

I have found a problem reading a flat file structure created in D4 when I attempt to read that same structure in D5.
 
Take the following simplified code -
 
procedure TForm1.Button1Click(Sender: TObject);
 
TYPE
 
    TClientRec = Record
      FileKey                : longint;
      DateOfBirth            : TDateTime;
    End;
 

VAR
    ClientRec                : TClientRec;
 
begin
 Edit1.Text:= IntToStr(SizeOf(ClientRec));
end;
In D4 Edit1.Text will show 12, whereas in D5 it shows 16. I can't find any documentation in D5 which indicates that there has been any change in the storage size of either the LongInt or TDateTime types.
 
I believe that the problem lies with the TDateTime variable as the LongInt is returning the correct value in the debugger and the date variables are not.
 
The problem is somewhat more complex than this simple example as the real record structure has a size of 140732 under D4 and 140752 under D5, and it only contains 2 TDateTime variables.
 
Anyone have any ideas.
 
Thanks in advance
Steve Galyer
 

Reply via email to