AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Array Index-Problem

Ein Thema von Neutral General · begonnen am 11. Dez 2006 · letzter Beitrag vom 11. Dez 2006
Antwort Antwort
Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#1

Array Index-Problem

  Alt 11. Dez 2006, 16:07
Hi,

Also entweder steh ich grad sowas von mega aufm Schlauch oder das hier ist komisch -.-

Delphi-Quellcode:
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]);
Wenn jetzt im Stringgrid steht

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 ? -.-
Aber es ist so:

Bla[0][0] = 0
Bla[0][1] = 2
Bla[1][0] = 1
Bla[1][1] = 3

....

Gruß
Neutral General
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat
Benutzerbild von 3_of_8
3_of_8

Registriert seit: 22. Mär 2005
Ort: Dingolfing
4.129 Beiträge
 
Turbo Delphi für Win32
 
#2

Re: Array Index-Problem

  Alt 11. Dez 2006, 16:14
Arrays sind aufgebaut wie eine Matrix, das heißt der erste Index ist die Zeile, der zweite die Spalte.
Manuel Eberl
„The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.“
- Terry Pratchett
  Mit Zitat antworten Zitat
Benutzerbild von Khabarakh
Khabarakh

Registriert seit: 18. Aug 2004
Ort: Brackenheim VS08 Pro
2.876 Beiträge
 
#3

Re: Array Index-Problem

  Alt 11. Dez 2006, 16:19
Und bei Cells ist es genau umgekehrt...
Sebastian
Moderator in der EE
  Mit Zitat antworten Zitat
Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#4

Re: Array Index-Problem

  Alt 11. Dez 2006, 16:21
... k danke... Son Schwachsinn -.-
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat
Benutzerbild von TeronG
TeronG

Registriert seit: 19. Jul 2004
Ort: München
960 Beiträge
 
Delphi 2007 Professional
 
#5

Re: Array Index-Problem

  Alt 11. Dez 2006, 16:24
Zitat von 3_of_8:
Arrays sind aufgebaut wie eine Matrix, das heißt der erste Index ist die Zeile, der zweite die Spalte.
Kann man das nicht halten/nennen wie man will?
Bzw. was ist dann der 3te, 4te oder gar 5te index?
龍 Der Unterschied zwischen Theorie und Praxis ist in der Praxis größer als in der Theorie.
  Mit Zitat antworten Zitat
Benutzerbild von 3_of_8
3_of_8

Registriert seit: 22. Mär 2005
Ort: Dingolfing
4.129 Beiträge
 
Turbo Delphi für Win32
 
#6

Re: Array Index-Problem

  Alt 11. Dez 2006, 17:01
Ja, aber so ist die Konvention, was die Darstellung betrifft.
Manuel Eberl
„The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.“
- Terry Pratchett
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:32 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz