Re: [fpc-pascal] Union field after property violates "field before property" rule + property of union field not possible.

2022-08-15 Thread Jean SUZINEAU via fpc-pascal
An if you eventually need a read only UnionField :  TmByte= packed array[0..7] of Byte;  TDataExample2  =   record     internal     : record    case integer    of 0: (mData: Int64); 1: (mByte: TmByte); end;    property mByte : TmByte read internal.mByte;   

Re: [fpc-pascal] Union field after property violates "field before property" rule + property of union field not possible.

2022-08-15 Thread Jean SUZINEAU via fpc-pascal
May the solution to your problem should be just :  TDataExample  =   record     case integer     of   0: (mData: Int64);   1: (mByte: packed array[0..7] of Byte);   2: (UnionField: Int64);   end; ? You aren't going to define a getter or setter method on your property, just an

Re: [fpc-pascal] Union field after property violates "field before property" rule + property of union field not possible.

2022-08-15 Thread Jean SUZINEAU via fpc-pascal
For this particular error I think you should just follow the advice of compiler in the error message : Le 14/08/2022 à 11:49, Skybuck Flying via fpc-pascal a écrit : // normal/standard property property StandardField : integer read mStandardField write mStandardField;

[fpc-pascal] Union field after property violates "field before property" rule + property of union field not possible.

2022-08-15 Thread Skybuck Flying via fpc-pascal
Delphi and presumably Free Pascal has some language inconsistency and problem/short coming concerning "Union Field" and/or "Union Property": The (previous) presented solution (included at end of post) is inconsistent in two ways: 1. Property of union not possible. 2. Order of field and