Board index » delphi » project file size Win 3.11 - Windows 95

project file size Win 3.11 - Windows 95

What can cuase the difference between the filesize in Windows 3.11
and Windows 95. The filestructure (file of record) is the same.
The file that was generated by the program compiled by the Windows 3.11
16 bits Delphi 1.0 cannot be read in by the program compiled by the
Windows 95 32 bits Delphi.
Who can tell me?

Best regards,

Peter de Hon

 

Re:project file size Win 3.11 - Windows 95


Peter,

Without seeing your record definition, it's hard to say for sure...
I'm willing to bet, though, that it's either due to using data
types that are different sizes under 16 and 32 bit, or that you're
not using 'TMyRecord = packed record' to handle the alignment.

If you'll post an example of the 16-bit record definition, we'll
be able to more easily help you track this down...

HTH

Ken
--
Ken White
kwh...@westelcom.com

Clipper Functions for Delphi
http://members.aol.com/clipfunc/

Quote
P. de Hon wrote:

> What can cuase the difference between the filesize in Windows 3.11
> and Windows 95. The filestructure (file of record) is the same.
> The file that was generated by the program compiled by the Windows 3.11
> 16 bits Delphi 1.0 cannot be read in by the program compiled by the
> Windows 95 32 bits Delphi.
> Who can tell me?

> Best regards,

> Peter de Hon

Re:project file size Win 3.11 - Windows 95


In article <3563121F.5...@wxs.nl>, "P. de Hon" <hon00...@wxs.nl> writes:

Quote
>What can cuase the difference between the filesize in Windows 3.11
>and Windows 95. The filestructure (file of record) is the same.
>The file that was generated by the program compiled by the Windows 3.11
>16 bits Delphi 1.0 cannot be read in by the program compiled by the
>Windows 95 32 bits Delphi.
>Who can tell me?

I think you will find that the alignment of the record elements is different in
D1 and D2/3. D1 is either packed (ie each element follows on directly in memory
from the previous) or each element is aligned on a 16 bit (2 byte) boundary.
D2/3 aligns the elements on a 32 bit (4 byte) boundary. Look up the $A ($ALIGN)
compiler directive, and the "packed" keyword in structured types, in Delphi 1
help and in Delphi 2/3 help and compare them.

I have a feeling that using the "packed" keyword in the record declaration (or
designing the structure to be effectively aligned) is the only way to ensure D1
/ D2 compatibility.

Hope this helps

Alan Lloyd
alangll...@aol.com

Re:project file size Win 3.11 - Windows 95


Is it simply because some of the data types in the record are different
sizes, e.g. 16 bit integer versus 32 bit integer?

Paul J. Poirier
p...@istar.ca

Quote
AlanGLLoyd wrote in message

<1998052020055100.QAA00...@ladder01.news.aol.com>...
Quote
>In article <3563121F.5...@wxs.nl>, "P. de Hon" <hon00...@wxs.nl> writes:

>>What can cuase the difference between the filesize in Windows 3.11
>>and Windows 95. The filestructure (file of record) is the same.
>>The file that was generated by the program compiled by the Windows 3.11
>>16 bits Delphi 1.0 cannot be read in by the program compiled by the
>>Windows 95 32 bits Delphi.
>>Who can tell me?

>I think you will find that the alignment of the record elements is
different in
>D1 and D2/3. D1 is either packed (ie each element follows on directly in
memory
>from the previous) or each element is aligned on a 16 bit (2 byte)
boundary.
>D2/3 aligns the elements on a 32 bit (4 byte) boundary. Look up the $A
($ALIGN)
>compiler directive, and the "packed" keyword in structured types, in Delphi
1
>help and in Delphi 2/3 help and compare them.

>I have a feeling that using the "packed" keyword in the record declaration
(or
>designing the structure to be effectively aligned) is the only way to
ensure D1
>/ D2 compatibility.

>Hope this helps

>Alan Lloyd
>alangll...@aol.com

Other Threads