Autor Beitrag
dany
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Mo 05.05.03 11:16 
Hallo,

ich habe ein Problem: Ich möchte sowas wie Memo1.Line.Add.Text := edit1.text machen. Also das ich dem Memo1 nach und nach Strings zuweise, so das dieses wächst. hat jemand einen Tip für die genaue Syntax.
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Mo 05.05.03 11:18 
Hallo,

versuche es mal so:
ausblenden Quelltext
1:
Memo1.Lines.Add(edit1.text);					


Gruß
Klabautermann
Terra23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 872

Win 8
Delphi 7
BeitragVerfasst: Mo 05.05.03 11:48 
Schön wäre es natürlich auch, wenn du mit

ausblenden Quelltext
1:
Edit1.Text:='';					


das Edit-Feld wieder löscht, damit nicht stets der gleiche Eintrag ins Memo geschrieben wird. ;-)

_________________
Hasta La Victoria Siempre
TimonWorld
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 397



BeitragVerfasst: So 11.05.03 16:23 
Titel: Noch ein Tipp
Hier geb ich dir noch ein Tipp:

ausblenden Quelltext
1:
2:
if edit1.text='' then messagedialog('Bitte Text eingeben , mtInformation, [mbOK]);
if <> edit1.text=''" then memo1.lines.add(edit1.text);



Timon Fr. (12)
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mo 12.05.03 07:51 
Hi Timon,

beide Zeilen Code die du gepostet hast funktionieren nicht. In der ersten Zeile fehlt ein ' und die zweite Zeile ist vom Aufbau her falsch:
ausblenden Quelltext
1:
if edit1.Text <> '' then					

Allerdings könntest Du dann auch Else benutzen:
ausblenden Quelltext
1:
2:
3:
4:
If Edit1.Text = '' Then 
  MessageDialog ('Bitte Text eingeben', mtInformation, [mbOK])
Else
  Memo1.Lines.Add (Edit1.Text);

Gruß
Tino