Autor Beitrag
wunsiedler
ontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 506
Erhaltene Danke: 4

Win7

BeitragVerfasst: So 05.12.04 12:49 
Hallo,

würde gern folgendes realisieren:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
for x := 1 to 10 do
 begin
  EditX.Text := 'Hallo';
 end;


Aber leider keinerlei Ahnung wie man das machen könnte. Ich hoffe einer von Euch weis das.

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt, Color- durch Highlight-Tags ersetzt
Moderiert von user profile iconTino: Topic aus Sonstiges verschoben am So 05.12.2004 um 21:16
.Chef
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1112



BeitragVerfasst: So 05.12.04 12:53 
ausblenden Delphi-Quelltext
1:
2:
for x:=1 to 10 do
  TEdit(FindComponent('Edit'+InttoStr(x))).Text:='Hallo';


Gruß,
Jörg

_________________
Die Antworten auf die 5 häufigsten Fragen:
1. Copy(), Pos(), Length() --- 2. DoubleBuffered:=True; --- 3. Application.ProcessMessages bzw. TThread --- 4. ShellExecute() --- 5. Keine Vergleiche von Real-Typen mit "="!
matze.de
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: So 05.12.04 12:54 
immer isser schneller :evil:

mfg matze

_________________
si tacuisses, philosophus mansisses.
sourcehunter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 482

Win XP | Suse 10.1
Delphi 2005 Pers.
BeitragVerfasst: So 05.12.04 12:54 
Ich mache sowas immer über ein Feld.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
Edits:Array[1..10] of TEdit;

Edits[1]:=Edit1;
Edits[2]:=Edit2;
.
.
.

_________________
Linux und OpenSource rulez!
thepaul
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29

Win XP
D7 Pers.
BeitragVerfasst: So 05.12.04 13:30 
sourcehunter hat folgendes geschrieben:
Ich mache sowas immer über ein Feld.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
Edits:Array[1..10] of TEdit;

Edits[1]:=Edit1;
Edits[2]:=Edit2;
.
.
.

war das eine Schleife??? :roll:
sourcehunter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 482

Win XP | Suse 10.1
Delphi 2005 Pers.
BeitragVerfasst: So 05.12.04 13:48 
Du kannst das Array dann in einer Schleife durchlaufen.

Noch eine Anmerkung zu dem Code:
Die erste Zeile muss in die Variablendeklaration und der Rest in den OnCreate-Teil deines Forms, oder wenigstens vor die Schleife.

_________________
Linux und OpenSource rulez!
Pille
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 105

Windows 7
DelphiXE Prof.
BeitragVerfasst: So 05.12.04 14:15 
Du kannst auch deine Komponenten mit der Tag Eigenschaft "markieren" und dann in einer Schleife alle Komponenten des Formulars abklappern, ob Tag den richtigen Wert aufweist. Der Komponentenname spielt dann keine Rolle mehr.

ausblenden Delphi-Quelltext
1:
2:
for i := 0 to ComponentCount-1 do
    if Components[i].Tag = 1 then ....


mfg Pille
wunsiedler Threadstarter
ontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 506
Erhaltene Danke: 4

Win7

BeitragVerfasst: So 05.12.04 14:49 
Werde Eure Vorschläge ausprobieren. Danke fürs erste.