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

Win XP

BeitragVerfasst: Mo 14.08.06 16:11 
hallo,

ist es möglich eine variabel bei einem memo einzugeben also zb.


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure Tform1.test(x:integer);
begin   

    memo[x].text := 'hallo';

end;


etwas in diesem styl (syntax kann in dem bsp. falsch sein^^)

danke schon ma im voraus :)

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt
freak4fun
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 604
Erhaltene Danke: 4

Win 7 Pro
VS 2013 Express, Delphi, C#, PHP, Java
BeitragVerfasst: Mo 14.08.06 16:15 
So weit ich weiß nein. Aber sag mal wasd du machen willst, vielleicht gibts ne schöne Lösung dafür. ;)

MfG
freak

_________________
"Ich werde auf GAR KEINEN Fall…!" - "Keks?" - "Okay, ich tu's."
i++; // zaehler i um 1 erhoehen
Darkpara Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 61

Win XP

BeitragVerfasst: Mo 14.08.06 16:19 
was ich vorhab ist folgendes:

ich hab 5 verschiedene memos und jedes memo entspricht:

ausblenden Delphi-Quelltext
1:
2:
3:
    memo1.text := '';
    for i := 0 to 10 - 1 do
    memo1.text :=''+memo1.text+''+textfinfr[i]+''+#13#10+'' ;


meine idee war nun das ganze in ne procedure zu stecken und über eine var aussuchen zu können in welches memo der text kommt

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mo 14.08.06 16:21 
Hallo!

Die Suche nach Suche in der Entwickler-Ecke FINDCOMPONENT sollte Dir helfen. :-)

Grüße
Christian

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 14.08.06 16:22 
Hallo und :welcome: in der Entwickler-Ecke,

Doch, das ist möglich. Für solche Sachen gibt es Suche in der Entwickler-Ecke FINDCOMPONENT.

ausblenden Delphi-Quelltext
1:
TMemo(FindComponent('memo' + IntToStr(i))).Text := ...					


sollte das gewünschte machen :D

Edit: Da war wieder jemand schneller...

_________________
We are, we were and will not be.
fidionael
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 232

Win XP SP2, Ubuntu 6.06
Delphi 7 PE, Delphi 3 Prof
BeitragVerfasst: Mo 14.08.06 16:22 
Es gibt eine tolle Funktion, welche sich FindComponent nennt:

ausblenden Delphi-Quelltext
1:
TMemo(FindComponent('Memo'+IntToStr(x))).Text := 'hallo';					


Falls du deine Memos als Array von Memos während der Laufzeit erstellt hast, funktioniert übrigens auch deine Idee mit MyMemo[x].Text := 'Hallo';.

Edit: Zu spät...


Zuletzt bearbeitet von fidionael am Mo 14.08.06 16:30, insgesamt 1-mal bearbeitet
Darkpara Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 61

Win XP

BeitragVerfasst: Mo 14.08.06 16:24 
oki danke viel mals :) werds gelich ma ausprobieren

Edit: oki funktionier danke euch :)