Thema: Delphi 3D Dynamic Array

Einzelnen Beitrag anzeigen

tkone

Registriert seit: 2. Okt 2009
Ort: Sachsen
63 Beiträge
 
Delphi 7 Professional
 
#3

Re: 3D Dynamic Array

  Alt 11. Jan 2010, 09:30
Zitat von nanix:
Delphi-Quellcode:
procedure TForm5.Button1Click(Sender: TObject);
var
i,j,l:integer;
 multiArray : Array of Array of array of string;
begin
  SetLength(multiArray,10);
  SetLength(multiArray[0],5);
  SetLength(multiArray[1],5);
  SetLength(multiArray[2],5);
  SetLength(multiArray[0][0],1);
  SetLength(multiArray[1][1],1);
  SetLength(multiArray[2][2],1);
If you want every Subarray(like you call the 2nd and 3rd dimension) to have other lengths, then you can do it the way you wrote.
But if every Subarray has he same length in one dimension(like in your example) then you can set his length much easier.

Code:
Setlength(multiarray,10,5,1)
  Mit Zitat antworten Zitat