Autor Beitrag
$veno
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 42



BeitragVerfasst: So 23.10.05 14:54 
Hallo.

Wie kann ich aus einem dynamischen array die zB ersten 3 Elemente entfernen, also das fortan das 4. Element des Arrays das erste ist?

Gruss Sven
Sprint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 849



BeitragVerfasst: So 23.10.05 15:50 
Per Schleife die Werte verschieben oder mit Move den Speicherbereich ab Position 4 nach 0 kopieren. Anschließend mit SetLength das Array kürzen.

Wäre gut gewesen, wenn du geschrieben hättest wie dein Array aufgebaut ist.

_________________
Ciao, Sprint.
$veno Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 42



BeitragVerfasst: So 23.10.05 18:01 
Mein array ist wie folgt aufgebaut:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
type Tmp3rec = record
       filename: shortstring;
       playcounts: integer;
     end;
     TPlaylist = file of TMp3rec;
     Tmp3recs = array of Tmp3rec;

var MP3recs: Tmp3recs;


Funktioniert hier move auch?
AndyB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1173
Erhaltene Danke: 14


RAD Studio XE2
BeitragVerfasst: Di 25.10.05 08:52 
Schon
MP3recs := Copy(MP3recs, 3, MaxInt);ausprobiert?

_________________
Ist Zeit wirklich Geld?