Thema: Delphi 3D Dynamic Array

Einzelnen Beitrag anzeigen

nanix
(Gast)

n/a Beiträge
 
#1

3D Dynamic Array

  Alt 10. Jan 2010, 23:21
Hello,

ok i have a problem with 3d dimensional dynamic array.How could i set each dimension seperatly.String value

Delphi-Quellcode:
Something 0
     Another 0
           That 0
     Another 1
           That 0
Delphi-Quellcode:
procedure TForm5.Button1Click(Sender: TObject);
var
i,j,l:integer;
 multiArray : Array of Array of array of string;
begin
  // Set the length of the 1st dimension of the multi-dim array
  SetLength(multiArray,10);

  // Set the length of the 3 sub-arrays
  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);


  // Set elements of this array
  multiarray[0,0,0]:='a'; //<< only sets last dimension
end;
  Mit Zitat antworten Zitat