Autor Beitrag
popi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26



BeitragVerfasst: Sa 10.06.06 07:57 
Hallo zusammen,

ich habe ein mehrdimensionales Array in der Form

events: array[0..6] of array of string;

und möchte alle Inhalte des Arrays löschen, ungeachtet, was drin steht.

Gibt es dafür einen Befehl ???

In der Hilfe konnte ich nichts passendes finden.

Danke und Grüße

popi
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Sa 10.06.06 08:02 
ausblenden Delphi-Quelltext
1:
for i := 0 to 6 do setLength( events[i], 0);					

_________________
Markus Kinzler.
popi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26



BeitragVerfasst: Sa 10.06.06 08:14 
Titel: Nochmal 1000 Dank !!!
...
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Sa 10.06.06 08:39 
*hust*
6mal auf Länge 0 setzen?
*hust*

@popi:
nen, befehl gibts dafür imho nich, aber folgende 2 Zeilen sin jetzt nicht so aufwändig, oder?

ausblenden Delphi-Quelltext
1:
2:
for i := 0 to 6 do
 events[i] := '';


mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)


Zuletzt bearbeitet von GSE am Sa 10.06.06 09:12, insgesamt 1-mal bearbeitet
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Sa 10.06.06 08:44 
Hallo GSE,

Die Inhalte des arrays events sind keine Strings, sondern je ein dynmaischer Array aus Strings. Das setLength() löscht diese dyn. Arrays.

_________________
Markus Kinzler.
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Sa 10.06.06 09:11 
oh, sry, jetzt seh ich's
hätte mir das vlt. genauer anschauen sollen :oops:

ich war aber von der Antwort "..." auch etwas irritiert :?:
ich mein ohne Worte? soll das Trauer ausdrücken? :?:

is aber wahrscheinlich noch zu früh zum Nachdenken ^^

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Sa 10.06.06 09:16 
Mir gings zuerst genauso, habe das 2. Array überlesen. Habs aber noch gemerkt, war dann aber zu faul nochmal so viel zu Tippen und hab nur den Code angepasst und den Rest gelöscht.

_________________
Markus Kinzler.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Sa 10.06.06 12:17 
user profile iconGSE hat folgendes geschrieben:
ich war aber von der Antwort "..." auch etwas irritiert :?:
ich mein ohne Worte? soll das Trauer ausdrücken? :?:
user profile iconpopi scheint einer der wenigen zu sein, die den Ttiel eines Postings benutzen, da steht also mehr als "..." :zwinker:

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Sa 10.06.06 12:47 
oh,
das is aber auch verdammt klein ^^

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
pascalsv
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 133

Win XP Prof. SP2 / Windows 7
Visual Studio 2008 / Silverlight 3 / Silverlight 4 Beta
BeitragVerfasst: Fr 25.08.06 16:21 
Komisch, bei mir funktioniert das nicht...
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
...
type
  TTrackArray = array[0..2] of string;
...
  public
    { Public-Deklarationen }
    aTrackArray: array of TTrackArray;
    aLeeresArray: array of TTrackArray;
...
procedure LeereArray;
begin
  lbMp3s.Clear;
  aTrackArray := aLeeresArray;
end;


Er meckert, aTrackArray und aLeeresArray seien inkompatible Typen. Das liegt wohl wieder an der dynamischen Länge, richtig?

Was kann ich tun?

Pascal
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Fr 25.08.06 16:26 
Hallo!

aTrackArray ist ja auch ein Array of TTrackArray (also ein Array von einem Array) und Du versuchst, dem ein TTrackArray (ein "normales" Array) zuzuweisen. Kann es sein, dass Du eigentlich diese Definition haben wolltest?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
...
  public
    { Public-Deklarationen }
    aTrackArray: TTrackArray;
    aLeeresArray: TTrackArray;


Grüße
Christian

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
pascalsv
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 133

Win XP Prof. SP2 / Windows 7
Visual Studio 2008 / Silverlight 3 / Silverlight 4 Beta
BeitragVerfasst: Fr 25.08.06 16:32 
*aufdieStirnpatsch*

Ja, Du hast recht....

Danke!!!

Pascal