How can I have the true "sizeof" of variant records? Gpc sizeof accepts only one parameter as type or variable so isn't possible to specify tags parameters for example:
type myrec_t = packed record a: integer; case b: boolean of true: (x: integer; y: integer); false: (case cc: char of 'a': (tst: integer; 'b': (t1: byte; t2: byte); 'c': (tx: real)); end; ... writeln(sizeof(myrec_t,true); writeln(sizeof(myrec_t,false,'a');
I tried to use the new statement instead, e.g.
var p: ^myrec_t;
begin new(p,true); writeln(sizeof(p^)); dispose(p,true); new(p,false,'a'); writeln(sizeof(p^));
but in both cases sizeof return the same value that is the maximum record size.
Thanks in advance.
Angelo Fumagalli