On Fri, 3 Aug 2001, Sven Jauring wrote:
Hi again!
I need to be able to specify not only 16 bit sizes but also 8 bit and 4 bit sizes as well. Is there anyone out there that could give me a hint of HOW to implement the functionality in GPC
Patched your program a little. It *might* be what you're looking for.
type INT0_255 = packed 0..255;
{ BITS = (BIT0,BIT1,BIT2,BIT3, BIT4,BIT5,BIT6,BIT7, BIT8,BIT9,BIT10,BIT11, BIT12,BIT13,BIT14,BIT15); }
bitarray = packed array [ 0..15 ] of integer ( 1 );
var VARIABLE1 : record case shortint of 0: (AWORD: shortint); 1: (MSB: INT0_255; LSB: INT0_255); 2: (BT : bitarray ); end;
begin writeln( sizeof (VARIABLE1)); end.
prints 2 (bytes)
Hopes this helps Russ