Autor Beitrag
kabizolis
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 86



BeitragVerfasst: Do 13.04.06 11:50 
hallo,
ist es möglich ein array zu bilden mit properties von Komponenten (TControl)?

Beispiel
es besteht ein bereits ein array mit Integerwerten "c_arNummer"...
der array Name der properties wäre z.B. "c_arProp"

ausblenden Delphi-Quelltext
1:
2:
3:
4:
c_arProp[1] := Edit1.width;
c_arProp[2] := Edit2.height;
c_arProp[3] := Label9.top;
c_arProp[4] := Memo1.left;


und diese dann in einer schleife ansprechen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
for i := 1 To 10
 do begin
  c_arProp[i] := c_arNummer[i];
 end;
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: Do 13.04.06 12:00 
Auf die Frage 'Ist es möglich' kann ich antworten: "Probiers es doch einfach aus! ;) " Eigentlich sollte das so funktionieren.

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



BeitragVerfasst: Do 13.04.06 12:05 
ja ich würde gerne aber wie erstellt man ein derartiges array?

v_arProp:array[1..10] of ?????;
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: Do 13.04.06 12:13 
Verständnisfrage: Willst du die Werte der Properties im Array speichern oder willst du über das Array auf Properties von Komponenten zugreifen?

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



BeitragVerfasst: Do 13.04.06 12:23 
das letztere... wobei ich mich frage inwiefern mein lösungsansatz überhaupt sinn macht... ;-)
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: Do 13.04.06 12:45 
user profile iconkabizolis hat folgendes geschrieben:
das letztere... wobei ich mich frage inwiefern mein lösungsansatz überhaupt sinn macht... ;-)

Ich dachte das erste ;) Bei dem was du vorhast, kann ich dir leider nicht helfen

Aber warum willst du das überhaupt machen? Vielleicht kann man dein Problem auch anders lösen ;)

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