Autor Beitrag
Kel'Thuzad
Hält's aus hier
Beiträge: 12



BeitragVerfasst: So 28.08.05 16:35 
Hi,

tut mir Leid falls es das Thema schon gibt, ich habe noch nichts gefunden..

Also, folgende Frage:

ich habe ein zweidimensionales Array zb. Ar[1..20,1..50] und will jetzt, das jedes einzelne dieser 20x50 Felder wiederrum aus einem 2D Array zb. Ar2[1..1,1..1] besteht; dieses Ar2 soll dann mit integer Werten gefüllt werden.

nun weis ich zwar wie man ein normales Array erstellt, aber nicht wie man da hinein nochmal ein zweites packt.

mfg

JK/Kel
Amateur
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 777

(Win98, WinMe) WinXP Prof
D3 Prof, D6 Pers, D2k5 Pers., Turbo C++ Explorer
BeitragVerfasst: So 28.08.05 16:38 
ich schätz ma array[1..20,1..20] of array [1..20,1..20] of string;

bin mir aber net sicher ob da nur nen 4 dimensionales array rauskommt oder was anderes...

_________________
"Kein dummes Gerede. Kein Rumrätseln. Denkt an nichts anderes mehr, nur noch an das, was vor euch liegt. Das ist die wahre Herausforderung. Ihr müßt euch vor euch selbst schützen, Leute." (Rennes in "Cube")
Beiträge: >700
LigH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 239

Win98SE, Win2000SP4
D7
BeitragVerfasst: So 28.08.05 19:33 
Oder etwas ausführlicher, wenn man mag (anstatt _ bitte sinnvolle Zahlen verwenden):
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
type
  TAr2 = array[_.._,_.._] of Integer;
  TAr1 = array[_.._,_.._] of TAr2;

var
  Ar: TAr1;

begin
  Ar[_,_][_,_] := 0;
end;
Amateur
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 777

(Win98, WinMe) WinXP Prof
D3 Prof, D6 Pers, D2k5 Pers., Turbo C++ Explorer
BeitragVerfasst: So 28.08.05 19:35 
is aber das selbe wienen 4 dimensionales array oder?
kann man auch schreiben Ar[_,_,_,_]:=0 oder gibt es dann nen unterschied? wenn ja wo...

_________________
"Kein dummes Gerede. Kein Rumrätseln. Denkt an nichts anderes mehr, nur noch an das, was vor euch liegt. Das ist die wahre Herausforderung. Ihr müßt euch vor euch selbst schützen, Leute." (Rennes in "Cube")
Beiträge: >700
LigH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 239

Win98SE, Win2000SP4
D7
BeitragVerfasst: So 28.08.05 20:18 
Theoretisch: Ja. Praktisch: Probier's aus...
Amateur
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 777

(Win98, WinMe) WinXP Prof
D3 Prof, D6 Pers, D2k5 Pers., Turbo C++ Explorer
BeitragVerfasst: So 28.08.05 20:31 
user profile iconLigH hat folgendes geschrieben:
Theoretisch: Ja. Praktisch: Probier's aus...


mit fällt nix ein wo ich nen 4 dimensionales array brauche oder wo ich eins einbinden könnte... ok nen zweidimensionales geht schon ma wenn man so ne art tabelle machen will nur halt nicht sichtbar hab aber grad keine lust das ma durchzuproggen..
is ja auch egal...ich mein das halt ma auf ner delphi seite gelesen zu haben dass array [_,_][_,_] das gleiche is wie [_,_,_,_]

_________________
"Kein dummes Gerede. Kein Rumrätseln. Denkt an nichts anderes mehr, nur noch an das, was vor euch liegt. Das ist die wahre Herausforderung. Ihr müßt euch vor euch selbst schützen, Leute." (Rennes in "Cube")
Beiträge: >700
Kel'Thuzad Threadstarter
Hält's aus hier
Beiträge: 12



BeitragVerfasst: So 04.09.05 16:17 
so.. danke an alle für die schnellen antworten..

ich hab

array[1..20,1..20] of array [1..20,1..20] of integer;

benutzt, das geht einwandfrei.

Bei LigH's Version kommt bei

" Ar[_,_][_,_] := 0; " eine Fehlermeldung Incompatible types array and integer oder so ähnlich..

thx alle
Amateur
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 777

(Win98, WinMe) WinXP Prof
D3 Prof, D6 Pers, D2k5 Pers., Turbo C++ Explorer
BeitragVerfasst: So 04.09.05 16:29 
dann hast du was falsch gemacht. bei mir funzt lighs version einwandfrei...
entweder hast du net für _ zahlen benutzt oder du hast es falsch deklariert...

_________________
"Kein dummes Gerede. Kein Rumrätseln. Denkt an nichts anderes mehr, nur noch an das, was vor euch liegt. Das ist die wahre Herausforderung. Ihr müßt euch vor euch selbst schützen, Leute." (Rennes in "Cube")
Beiträge: >700
adfontes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 82

Win7 (64bit), WinXP
Delphi 2010 Prof, Delphi XE2 (Trial)
BeitragVerfasst: So 04.09.05 17:05 
user profile iconKel'Thuzad hat folgendes geschrieben:
Bei LigH's Version kommt bei

" Ar[_,_][_,_] := 0; " eine Fehlermeldung Incompatible types array and integer oder so ähnlich..


ich würde mal drauf tippen, dass es an den '_' liegt, da er ja meinte, es würde was von Integer type missmatches schreiben, bzw. inkompatiblen Typen ^^

greetz
adfontes
Kel'Thuzad Threadstarter
Hält's aus hier
Beiträge: 12



BeitragVerfasst: Mo 05.09.05 21:57 
Ich habe statt den "_" Zahlen genommen, falls du das meinst.. :roll:
Amateur
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 777

(Win98, WinMe) WinXP Prof
D3 Prof, D6 Pers, D2k5 Pers., Turbo C++ Explorer
BeitragVerfasst: Di 06.09.05 20:51 
bei mir gehts lighs also haste selbst nen fehler gemacht oder das geht bei älteren delphi versionen net aber das glaub ich net

_________________
"Kein dummes Gerede. Kein Rumrätseln. Denkt an nichts anderes mehr, nur noch an das, was vor euch liegt. Das ist die wahre Herausforderung. Ihr müßt euch vor euch selbst schützen, Leute." (Rennes in "Cube")
Beiträge: >700
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Di 06.09.05 20:54 
Bei mir (D7) geht es auch.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Kel'Thuzad Threadstarter
Hält's aus hier
Beiträge: 12



BeitragVerfasst: Mi 07.09.05 16:20 
hm.. ich hab Delphi 6.0

kann sein dass es an der Version liegt.. hab eigentlich sonst alles genauso gemacht wies da stand..