I recently had to change from Delphi 5->6 (if'n it ain't broke don't fix it, but it broke so...) I have applied all available maintenance to D6.
I have records built like:
Sub_Rec = Record
v1 : Integer;
v2 : integer;
case byte of
1: (v3 : Integer);
2: (v4 : String);
3: (v5 : String[10];
case integer of
1: (vx : byte);
2: (vy : Longint));
End;
Problem is that at each "case" under D6 there are "additional bytes" that have been added to the record. I wrote a program that calculates the offset of every variable and there are REALLY extra bytes that cannot be accounted for.
Both D5 and D6 have been set to NOT align (or to byte align) variables so there should be no offset to "next variable" based on variable type and the "map" I produce from the compiled D5 version shows no gaps in the variables.
The problem this creates is that I still use D5 programs at the same time as the ONE D6 program that had to be converted and the records come out 3 bytes different, right at the "case" points and that of course creates a "read past end of file" error.
I can supply the program if someone really loves to debug as I can't find any other entries that address this issue.
Thanks for any help
JGS
I have records built like:
Sub_Rec = Record
v1 : Integer;
v2 : integer;
case byte of
1: (v3 : Integer);
2: (v4 : String);
3: (v5 : String[10];
case integer of
1: (vx : byte);
2: (vy : Longint));
End;
Problem is that at each "case" under D6 there are "additional bytes" that have been added to the record. I wrote a program that calculates the offset of every variable and there are REALLY extra bytes that cannot be accounted for.
Both D5 and D6 have been set to NOT align (or to byte align) variables so there should be no offset to "next variable" based on variable type and the "map" I produce from the compiled D5 version shows no gaps in the variables.
The problem this creates is that I still use D5 programs at the same time as the ONE D6 program that had to be converted and the records come out 3 bytes different, right at the "case" points and that of course creates a "read past end of file" error.
I can supply the program if someone really loves to debug as I can't find any other entries that address this issue.
Thanks for any help
JGS