[fpc-pascal] How to allocate a 2D array?

leledumbo leledumbo_cool at yahoo.co.id
Tue Jan 13 05:27:11 CET 2009


He wants 2D dynamic arrays, let's give him one:
type
  TMyArray = array of array of Float;
var
  MyArray: TMyArray;
begin
  SetLength(MyArray,Width,Height); // Valid index now:
[0..Width-1,0..Height-1]
  // Do something with MyArray
  // No deallocation needed, the compiler does this for you
end;
-- 
View this message in context: http://www.nabble.com/How-to-allocate-a-2D-array--tp21414552p21429315.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.




More information about the fpc-pascal mailing list