fork download
  1. {$mode objfpc}
  2. program ideone;
  3.  
  4. type
  5. TA=record a:Integer; end;
  6. TLA=array of TA;
  7. TB=record b:Integer; La:TLA; end;
  8. TLB=array of TB;
  9. TX=record x:Integer; Lb:TLB; end;
  10.  
  11. function test:TX;
  12. begin
  13. SetLength(Result.Lb,2);
  14. SetLength(Result.Lb[0].La,2);
  15. SetLength(Result.Lb[1].La,2);
  16. Result.Lb[0].La[0].a:=11;
  17. Result.Lb[0].La[1].a:=12;
  18. Result.Lb[1].La[0].a:=21;
  19. Result.Lb[1].La[1].a:=22;
  20. end;
  21.  
  22. var R:TX;
  23. var Y,X:Integer;
  24. begin
  25. R:=test;
  26. for Y:=0 to High(R.Lb) do
  27. begin
  28. for X:=0 to High(R.Lb[Y].La) do Write(' ',R.Lb[Y].La[X].a);
  29. WriteLn;
  30. end;
  31. end.
Success #stdin #stdout 0s 276KB
stdin
Standard input is empty
stdout
 11 12
 21 22