record recursive dynarray



record_recursive_dynarray
Smart pascal source code
type TRecord = record F: Integer; A: array of TRecord; procedure WriteLnMe; end; procedure TRecord.WriteLnMe; var i: Integer; begin WriteLn(F); for i := A.Low to A.High do A[i].WriteLnMe; end; var r: TRecord; var r2: TRecord; r.F := 1; r2.F := 2; r.A.Add(r2); r2.F := 3; r.A.Add(r2); r.A.Add(r2); r.WriteLnMe; {<<< RESULT - CONSOLE LOG >>> ----------------------------- 1 2 3 3 ----------------------------- {<<<<<<<<< THE END >>>>>>>>>}