I have this type:
type
pTRegex_sec=^TRegex_sec;
TRegex_sec = record
secs: Array of pTRegex_sec;
len: byte;
hasSections: boolean;
hasUnits: boolean;
units: Array of TRegex_unit;
end;
type TRegex_assertions = record
len: byte;
secs: Array of TRegex_sec;
end;
I would like to allocate memory for the type TRegex_sec:
var Assertions: TRegex_assertions;
begin
setlength(Assertions.secs, 1);
GetMem(Assertions.secs[0], SizeOf(TRegex_sec));
end;
The error I have is "Incompatible types": Assertions.secs[0]<-- here
Another attempt, same error:
New(Assertions.secs[0]);
How to do it correctly?