Please consider this code:
NodeStruct = packed record
ID : Integer;
end;
TNodeArray = Array of NodeStruct;
strNodePtr = ^stringNodeStruct ;
stringNodeStruct = record helper for NodeStruct
stringVal : String;
Parent : strNodePtr;
Children : Array of strNodePtr;
prev : strNodePtr;
next : strNodePtr;
end;
This does not compile:
Error Message:
Error: An interface, helper or Objective-C protocol or category cannot contain fieldsI also tried:
stringNodeStruct = packed record (NodeStruct)
stringVal : String;
Parent : strNodePtr;
Children : Array of strNodePtr;
prev : strNodePtr;
next : strNodePtr;
end;
Error:
Fatal: Syntax error, "identifier" expected but "(" foundWell, that pretty much tells me everything . But, I would like to know, if it is possible to somehow "extend" or "inherit" a record, and then add more fields to it? In the worst case, I could always use Classes, but records would be nice. Thank you