Thema: Delphi 3D Dynamic Array

Einzelnen Beitrag anzeigen

tkone

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

Re: 3D Dynamic Array

  Alt 11. Jan 2010, 10:46
the values are set by accessing the correct field and associate a value to it.
like you wrote already.

in my eyample you got a cubic field with 3x3x3 elements.

with multiarray[0,0,0] you access the first element (upper left field)
with multiarray[2,2,2] you access the last element (lower right field)
a.s.o.

if you want to insert strings into a whole dimension(for example fill the complete 3rd dimension with 'a')
just put it into a repeating-prozess.
Delphi-Quellcode:
for i:=0 to 2; do //start to finish
multiarray[0,0,i]:='a';
with the proposal of klaus1 you fill the complete array with 'a'
because the 2 for functions access every element of your array.
Angehängte Grafiken
Dateityp: bmp unbenannt_106.bmp (79,8 KB, 8x aufgerufen)
  Mit Zitat antworten Zitat