There is an array consisting of three-dimensional arrays, I want to find out what is in each mkts index, how is it better and easier to find out all the values ​​in each index? How to use the index to find out the value?

mkts = array [0..3, 1..6, 1..16] of SmallInt; TPmkts = ^mkts; Pkts: array[1..Blocks, 1..RTParts] of TPmkts = ( (nil, nil), (nil, nil), (nil, nil), (nil, nil) ); 
  • you can use nested loops in loops in loops ... or write a function of recursive enumeration of elements - Vitaly Vikhlyaev
  • @VitalyVikhlyaev I would be glad if you wrote an example. - creamsun

1 answer 1

 var a, b, c, d, e: Integer; item: TPmkts; begin for a := Low(Pkts) to High(Pkts) do for b := Low(Pkts[a]) to High(Pkts[a]) do begin item := Pkts[a, b]; if item <> nil then begin for c := Low(item^) to High(item^) do for d := Low(item^[c]) to High(item^[c]) do for e := Low(item^[c, d]) to High(item^[c, d]) do ShowMessage(IntToStr(item^[c, d, e])); end; end; end;