Re: [fpc-pascal] Variant record consistency

2016-08-07 Thread Gerhard Scholz
I assume, my response was a bit unclear. If you code it like this, you should get a runtime-error or compiler-error if the two variants are not same-sized, and I assume, this is what you wanted. - Original Message - From: "Gerhard Scholz" To: "FPC-Pascal users discussions" Sent: Sun

Re: [fpc-pascal] TArray.Sort(array) returns 'Error: Identifier not found "TArray" '

2016-08-07 Thread silvioprog
On Aug 4, 2016 3:08 AM, "Maciej Izak" wrote: > > 2016-08-04 3:16 GMT+02:00 silvioprog : >> >> So, is this the best way to solve this problem? > > TArrayHelper is marked as experimental structure and exist only temporary for bug workaround (see page 1 of https://github.com/dathox/generics.collectio

Re: [fpc-pascal] TArray.Sort(array) returns 'Error: Identifier not found "TArray" '

2016-08-07 Thread silvioprog
On Thu, Aug 4, 2016 at 3:07 AM, Sven Barth wrote: > > Am 04.08.2016 03:17 schrieb "silvioprog" : > > So, is this the best way to solve this problem? > > For now, yes. Maciej still needs to adjust the code to make use of the features added in trunk. Great. Added as reminder in my TODO list. :-)

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

[fpc-pascal] Variant record consistency

2016-08-07 Thread Mark Morgan Lloyd
Given a declaration const topDataQword= 29; topNameChar= 231; type Tfnord= record case boolean of false: (data: array[0..topDataQword] of qword); true: (name: array[0..topNameChar] of char; inode: qword) (* For recovery if