Re: [fpc-pascal] Variant record consistency

2016-08-08 Thread Mark Morgan Lloyd
Tomas Hajny wrote: On Sun, August 7, 2016 18:11, Mark Morgan Lloyd wrote: is it possible to enforce a rule that the two record variants must be the same size? What would the rule supposedly do? As far as I know, all the variants take the size of the largest one technically (in memory). Do yo

Re: [fpc-pascal] Variant record consistency

2016-08-07 Thread Gerhard Scholz
cussions" Sent: Sunday, August 07, 2016 8:00 PM Subject: Re: [fpc-pascal] Variant record consistency if same size is necessary, I would do it like this: const topDataQword= 29; topNameChar= 231; type Tfnord1 = array[0..topDataQword] of qword ; Tfnord2 = record name:

Re: [fpc-pascal] Variant record consistency

2016-08-07 Thread Tomas Hajny
On Sun, August 7, 2016 18:11, Mark Morgan Lloyd wrote: Hello Mark, > Given a declaration > > const >topDataQword= 29; >topNameChar= 231; > > type >Tfnord= record > case boolean of >false: (data: array[0..topDataQword] of qword); >true: (n

Re: [fpc-pascal] Variant record consistency

2016-08-07 Thread Gerhard Scholz
if same size is necessary, I would do it like this: const topDataQword= 29; topNameChar= 231; type Tfnord1 = array[0..topDataQword] of qword ; Tfnord2 = record name: array[0..topNameChar] of char; inode: qword end ; Tfnord= rec

Re: [fpc-pascal] Variant record consistency

2016-08-07 Thread Jonas Maebe
On 07/08/16 18:11, Mark Morgan Lloyd wrote: is it possible to enforce a rule that the two record variants must be the same size? No. Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listin