[fpc-pascal] Fixed record files

James Richters james at productionautomation.net
Sun Jul 9 21:46:21 CEST 2017


Thanks for the link.   For best compatibility should I make it:

 

Type

      DrawCMD = Packed Record

                   GC: Word;

                   PX,PY,PZ,GX,GY,GZ,GI,GJ,R,SA,EA:Double;

                End;

 

 

Or 

 

Type

     {$PackRecords 2}   
      DrawCMD =  Record

                   GC: Word;

                   PX,PY,PZ,GX,GY,GZ,GI,GJ,R,SA,EA:Double;

                End;

     {$PackRecords default}

 

Or am I not understanding this correctly?

 

James

 

From: fpc-pascal [mailto:fpc-pascal-bounces at lists.freepascal.org] On Behalf Of Vojtech Cihák
Sent: Sunday, July 09, 2017 2:44 PM
To: FPC-Pascal users discussions <fpc-pascal at lists.freepascal.org>
Subject: Re: [fpc-pascal] Fixed record files

 

Hi,

 

"packed record" is for compatibility. Its guaranteed that inner alignment and size of record will be always the same and will not change in future versions of compiler, unlike the plain "record".

 

https://www.freepascal.org/docs-html/ref/refsu15.html

 

V.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20170709/abb95fec/attachment.html>


More information about the fpc-pascal mailing list