Autor Beitrag
Texter-J
Hält's aus hier
Beiträge: 6



BeitragVerfasst: Sa 16.06.07 18:12 
Hallo, möchte für ein Verschlüsslungsprogramm mehrere Strings (die Schlüssel) zu einem Array zusammenfügen.
Das funktioniert schon ganz gut, ich möchte aber eine Zählschleife anstatt einfache Alternativen verwenden.
Hier der bisherige Quelltext:


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
function schluesselbundzusammenfuegen : schluearray;
var lengthbund: integer;
begin
 lengthbund := strtoint(Form1.AnzSchlueEdit.Text);
 setlength(result,(lengthbund+1));
 if lengthbund > 0 then result[1] := Form1.Key1Edit.Text;
 if lengthbund > 1 then result[2] := Form1.Key2Edit.Text;
 if lengthbund > 2 then result[3] := Form1.Key3Edit.Text;
 if lengthbund > 3 then result[4] := Form1.Key4Edit.Text;
 if lengthbund > 4 then result[5] := Form1.Key5Edit.Text;
 if lengthbund > 5 then result[6] := Form1.Key6Edit.Text;
 if lengthbund > 6 then result[7] := Form1.Key7Edit.Text;
 if lengthbund > 7 then result[8] := Form1.Key8Edit.Text;
 if lengthbund > 8 then result[9] := Form1.Key9Edit.Text;
end;


Ich denke, dass das durch eine variable Editfeldabfrage funktionieren auch könnte, also "Form1.Key X Edit.Text"
- aber wie?
Danke im Vorraus :)

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt


Zuletzt bearbeitet von Texter-J am Sa 16.06.07 20:33, insgesamt 3-mal bearbeitet
bflegel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 193
Erhaltene Danke: 1

Win XP, Win 7, BS2000
D5
BeitragVerfasst: Sa 16.06.07 18:21 
Zitat:
Ich denke, dass das durch eine variable Editfeldabfrage funktionieren auch könnte, also "Form1.Key X Edit.Text"
- aber wie?


Da dürfte "Findcomponent" Dein Freund sein :)

www.delphi-forum.de/...hlight=findcomponent

// edit: quotes eingefügt

_________________
I know all the jokes about my name