Autor Beitrag
Darkpara
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 61

Win XP

BeitragVerfasst: Di 15.08.06 09:55 
hallo,

vorweg ja meine letzen fragen, wie auch diese dienen dazu mein programm zu strukturieren und kleiner zu machen am anfang hatte ich jeden fall einzeln behandelt nun möchte ich alles bischen kürzer gestalten..

so nun aber zu der frage :)

ich habe 7 memo's und 7 checkboxen, nun möchte ich das nur die memo's angezeigt werden dessen checkbox aktiviert ist ich dachte an ne

ausblenden Delphi-Quelltext
1:
    for x := 1 to 7 do					


halt bisel abgeändert

ausblenden Delphi-Quelltext
1:
    for x := 1 to 3 and 6 to 7 do					


gibts da ne syntax dazu?


hier noch kompletter programm aussschnitt:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure Tform2.test();

begin


    for x := 1 to 7 do
    TMemo(FindComponent('memo'+IntToStr(x))).Text := '';

    for x := 1 to 7 do begin
    for i := 1 to 10 do
    TMemo(FindComponent('Memo'+IntToStr(x))).Text := ''+TMemo(FindComponent('memo'+IntToStr(x))).text+' '+textfin[x][i]+''+#13#10+''+#13#10+'' ;
    end;
end;


danke im voraus :)

Moderiert von user profile iconAXMD: Delphi-Tags hinzugefügt
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Di 15.08.06 10:01 
so ist mir das zu umständlich zu lesen, der quelltext. Kannst du das bitte mal in diese Tags setzen? Das macht man bei Editieren -> Bereiche

Dann sieht das so aus: delphi
WASEO
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 56

Win98, Win2000, WinXP
D6 Prof, D7 Prof
BeitragVerfasst: Di 15.08.06 10:15 
Wenn ich Dich richtig verstanden habe, könnte es so gehen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
for x := 1 to 7 do 
begin
  if TCheckBox(FindComponent('CheckBox'+IntToStr(x))).Checked then
    for i := 1 to 10 do
      TMemo(FindComponent('Memo'+IntToStr(x))).Text := ''+TMemo(FindComponent('memo'+IntToStr(x))).text+' '+textfin[x][i]+''+#13#10+''+#13#10+'' ;
end;

_________________
Erstaunlich sind nicht die Dinge, die wir nicht kennen, sondern die wir kennen und die nicht so sind.
Darkpara Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 61

Win XP

BeitragVerfasst: Di 15.08.06 10:30 
ah ja klar, jetzt wo du es sagst :D !! danke dir