[fpc-pascal] variant part of a record
JeLlyFish.software at gmx.net
Wed Sep 20 02:10:53 CEST 2006
Пётр Косаревский wrote:
>> Yes, you do. :)
>> some_type = record
>> case Something : byte of
>> 1: (x,y: word);
>> 2: (z: longword);
> Thank you, Jonas and Vincent, but I was vague: what I want is blockread'ing, so I have to use
> Something: byte;
> case byte of
> 1: (x,y: word);
> 2: (z: longword);
No, AFAIK you don't have to, it's the same, just a different syntax.
Your "Something" byte discrimant will be there. Or where else do you
think it is stored within the structure?
Probably you should used a "packed record", though. And it's in no way
portable, of course.
More information about the fpc-pascal