[fpc-pascal] variant part of a record

Vinzent Hoefler JeLlyFish.software at gmx.net
Tue Sep 19 17:35:51 CEST 2006


On Tuesday 19 September 2006 15:21, Пётр Косаревский wrote:

> Do I get it right, that a construction like
>     record
>     Something: byte;
>      case Something of
>       1: (x,y: word);
>       2: (z: longword);
>     end;
> Is impossible in FPC?

Yes, you do. :)

Nevertheless

   some_type = record
      case Something : byte of
      1: (x,y: word);
      2: (z: longword);
   end;

would be the correct Pascal syntax and - surprise, surprise - is 
accepted by fpc. ;)


Vinzent.




More information about the fpc-pascal mailing list