![]() |
Array Index-Problem
Hi,
Also entweder steh ich grad sowas von mega aufm Schlauch oder das hier ist komisch -.-
Delphi-Quellcode:
Wenn jetzt im Stringgrid steht
for y:= 0 to High(LGS.Bla) do begin
LGS.Ext[y] := StrToInt(Stringgrid2.Cells[0,y]); // unwichtig for x:= 0 to High(LGS.Bla[y]) do begin LGS.Bla[y][x] := StrToInt(Stringgrid1.Cells[y,x]); 0 1 2 3 dann soll Bla[0][0] = 0 Bla[0][1] = 1 Bla[1][0] = 2 Bla[1][1] = 3 sein.. Das müsste doch auch eig nach dem Code so werden oder ? :gruebel: :wall: -.- Aber es ist so: Bla[0][0] = 0 Bla[0][1] = 2 Bla[1][0] = 1 Bla[1][1] = 3 .... Gruß Neutral General |
Re: Array Index-Problem
Arrays sind aufgebaut wie eine Matrix, das heißt der erste Index ist die Zeile, der zweite die Spalte.
|
Re: Array Index-Problem
Und bei Cells ist es genau umgekehrt...
|
Re: Array Index-Problem
... k danke... Son Schwachsinn -.-
|
Re: Array Index-Problem
Zitat:
Bzw. was ist dann der 3te, 4te oder gar 5te index? :mrgreen: |
Re: Array Index-Problem
Ja, aber so ist die Konvention, was die Darstellung betrifft.
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:21 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz