Autor Beitrag
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Di 11.10.05 19:12 
Also ich habe mal was von dynamischen Arrays gelesen, dass man da die Anzahl der Einträge zur Laufzeit ändern kann. Ich habe schon in der forensuche nachgesehen, aber mit diesem 'urschleim' hat sich da kein beitrag beschäftigt. Also ich möchte wissen, wie man so ein dyn. a. deklariert und einsetzt.

Thx cu koller

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Alstar
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 827



BeitragVerfasst: Di 11.10.05 19:16 
Guckst du hier: www.dsdt.info/search...=%2Ftipps&=Suche
Alstar

//EDIT: Fehlerhaften Link erstezt


Zuletzt bearbeitet von Alstar am Di 11.10.05 19:18, insgesamt 2-mal bearbeitet
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 11.10.05 19:16 
Moin!

Und die Delphi-Hilfe hast du zu dem Thema schon "befragt"? :wink:

cu
Narses
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Di 11.10.05 19:21 
Ich meine zwar, dass in der Delphi-Hilfe was dazu steht, aber trotzdem hier ein paar Hinweise:
Deklaration:
ausblenden Delphi-Quelltext
1:
2:
var
  arr : Array of String; // Dynamisches Array von Strings

Größe setzen:
ausblenden Delphi-Quelltext
1:
2:
3:
  SetLength(arr, 10); // Array auf 10 Strings gesetzt. Zählung geht von 0 bis 9
  SetLength(arr, 0); // Gibt Speicher vom Array wieder frei
  arr := Nil; // Macht das gleiche

Sonstiges:
- Length gibt die Anzahl der Elemente
- Mit High und Low stellst du die Grenzen des Array fest. Sinnvoll wenn durchs Array laufen musst.

Ansonsten wird es überwiegend wie ein normales Array verwendet.
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 14.10.05 12:22 
Titel: ad
Danke, das hat mirschon sehr weitergeholfen :wink2:

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot