Hello,
Does FPC provide a way to determine the size of a variant record up to and including a specific field/variant ?
For instance, in the following sample:
{$APPTYPE CONSOLE}
type
TSOME_VARIANT_TYPE = record
VariantSize : DWORD;
SomeField : qword;
case integer of
1 : (
a : byte;
);
2 : (
b : word;
);
3 : (
c : DWORD;
);
4 : (
d : qword;
);
end;
var
Size : DWORD;
begin
{ how to get the size up to and including field a or b or c ? }
{ Size := ??? }
end.
Is there a way to determine the size of the record up to and including a (but not b, c and d) ? or upto and including b (or c) excluding the fields that follow it ?
Thank you for your help.