A-man Posted April 18, 2012 Share Posted April 18, 2012 From what I've read on the wiki, it seems like T2DpointArray is the way to go, but I don't understand how i'd manipulate an array of like 300x400 or something. Can someone help me out? I've tried: my_arr[0..300][0..400]: array of integer; my_arr[0..300, 0..400]: array of integer; and my_arr: array of integer; followed by setarraylength(my_arr,n); but none of them can do what I'm looking for. Basically I want to be able to store and get values from this table using variables x and y to denote the row and column. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted April 18, 2012 Share Posted April 18, 2012 I had some of those same issues when i first started with these arrays. The best way is to store the data using for loops. remember a 2d array is 2 sets of arrays so ea array needs to have its length set. [scar] program New; Procedure DoSomething; Var ATIA: T2DIntArray; I,II: Integer; Begin // Storing Data dynamicly For I := 0 to 49 do Begin SetLength(ATIA, Length(ATIA) + 1); // increase the first array For II := 0 to 9 do Begin SetLength(ATIA, Length(ATIA) + 1); // increase the Second array ATIA[iI] := Random(13000); end; end; // Storing Data using a fixed array SetLength(ATIA, 50); For I := 0 to 49 do SetLength(ATIA, 10); For I := 0 to 49 do For II := 0 to 9 do ATIA[iI] := Random(13000); // Reteriving Data For I := Low(ATIA) to HIGH(ATIA) do For II := Low(ATIA) to High(ATIA) do Writeln(ATIA[iI]); end; begin DoSomething; end. [/scar] Quote Link to comment Share on other sites More sharing options...