Autor Beitrag
ConditionZero
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 190

Win XP
Delphi 7 PE, C++ (Dev-C++), HTML+PHP (Dreamweaver MX), JavaScript(MS FrontPage)
BeitragVerfasst: Mo 25.12.06 18:42 
Moin,
Ich möchte eine variable deklarieren mit dynamischen namen also zur verständnis hier mein code:

ausblenden Delphi-Quelltext
1:
2:
3:
procedure TNewQuestion.OKBtnClick(Sender: TObject);
var
 Edit1.Text: TStringList;


ich hoff ihr versteht was ich meine ;-)


LG
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mo 25.12.06 18:45 
Schau Dir mal Arrays bzw. FindComponent an .... Vielleicht hilft Dir das ein wenig weiter ...

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
ConditionZero Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 190

Win XP
Delphi 7 PE, C++ (Dev-C++), HTML+PHP (Dreamweaver MX), JavaScript(MS FrontPage)
BeitragVerfasst: Mo 25.12.06 18:52 
Wie ich mit Arrays hier weiterkommen soll weiß ich nicht weil ob ich jetzt das mach:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
Array[1]:= Edit1.Text;
...

var
Array[1]: StringList;


oder einfach direkt so:

ausblenden Delphi-Quelltext
1:
2:
var
Edit1.Text: StringList;


kommt sogesehen ja aufs gleiche raus...


LG
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: Mo 25.12.06 19:04 
Du kannst Variablen nicht einen dynamischen Namen geben, warum auch? Was hast du denn vor?

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
ConditionZero Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 190

Win XP
Delphi 7 PE, C++ (Dev-C++), HTML+PHP (Dreamweaver MX), JavaScript(MS FrontPage)
BeitragVerfasst: Mo 25.12.06 19:19 
Soll zur Übersicht für den Programmierer dienen, weil es am Ende mal seehr viele werden.

Aber wenn es definitiv nicht geht, hab ich eine Alternative ;-)


Thx

LG

//Edit: Nein mit einem Array würde es nicht gehen bevor ihr das sagt :-D
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: Mo 25.12.06 19:25 
Ergibt trotzdem keinen Sinn, denn wenn das Programm läuft, kann der Programmierer nix tun und wenn es nicht läuft, dann kann es auch keine dynamischen Variablen geben.

=> Geht nicht.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
ConditionZero Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 190

Win XP
Delphi 7 PE, C++ (Dev-C++), HTML+PHP (Dreamweaver MX), JavaScript(MS FrontPage)
BeitragVerfasst: Mo 25.12.06 19:29 
Ja genau das hab ich mir auch gedacht wo ich dann nochmal meine Weiße das zu Proggen überdacht habe...