Autor Beitrag
kalle2000
Hält's aus hier
Beiträge: 7



BeitragVerfasst: Mo 16.03.09 14:03 
Hallo zusammen...

neuer Thread dann wohl.
Und nein, es ist keine Hausaufgabe.
Sondern vielmehr eine Aufgabe, die ich mir selbst zum Ziel und zum Üben gestellt habe!
Es gibt auch keine Note dafür.

Okay. Problem Nummer Eins.

Das Programm läuft.
Es wird ein Button betätigt.
Jetzt soll der Prozess des Buttons in die nebenstehende Memobox einen Text schreiben.
Dieser Text müsste als TStrings definiert sein.

Wie definiere ich meinen Text als TStrings?


Moderiert von user profile iconNarses: Topic aus Sonstiges (Delphi) verschoben am Mo 16.03.2009 um 14:23
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 16.03.09 14:23 
Moin und :welcome: im Forum!

So kannst du den Inhalte eines TMemo setzen:
ausblenden Delphi-Quelltext
1:
Memo1.Text := 'Hallo';					

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Timosch
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1314

Debian Squeeze, Win 7 Prof.
D7 Pers
BeitragVerfasst: Mo 16.03.09 14:55 
Und um eine Zeile hinzuzufügen, schreibst du Memo1.Lines.Add('...');

_________________
If liberty means anything at all, it means the right to tell people what they do not want to hear. - George Orwell
BlackDragon
Hält's aus hier
Beiträge: 10


Delphi 7 Prof.,Turbo Delphi 2006, #Develop
BeitragVerfasst: Mo 16.03.09 15:18 
Hi.

Nur zur Ergänzung:

Lines ist eine Property von der Klasse TMemo und vom Typ TStrings.

Wie du den Text dem Memo hinzufügst bzw. setzt, siehst du ja schon in den beiden Posts vorher.

Gruss

BlackDragon

_________________
EDV-Systeme verarbeiten, womit sie gefüttert werden.
Kommt Mist rein, kommt Mist raus. -André Kostolany-
kalle2000 Threadstarter
Hält's aus hier
Beiträge: 7



BeitragVerfasst: Mo 23.03.09 10:33 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Bu_Geb1Click(Sender: TObject);
begin
  Memo05.Text := 'Hallo Onkel';
  Memo05.Lines.Add := ('2');
end;

Dieser Quelltext funktioniert bei mir nicht?
Was muss ich bei Lines.Add hinzufügen?

Moderiert von user profile iconNarses: Delphi-Tags hinzugefügt
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Mo 23.03.09 10:38 
1) verwende hier im forum bitte die [delphi][/delphi]-Tags, um deinen geposteten Quelltext besser lesbar zu machen.

2) Memo05.Lines.Add ist eine Methode die einen Parameter verlangt, demnach kannst du nichts zuweisen, da es keine variable ist.

So sollte das aussehenb:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Bu_Geb1Click(Sender: TObject);
begin
  Memo05.Text := 'Hallo Onkel';
  Memo05.Lines.Add('2');
end;


3) bitte lerne deinen Code einzurücken, das macht ihn übersichtlicher

4) Darf ich dir Christian's Crashkurs nahelegen? Damit sollten solche "Basics" gut lernbar sein. ;-)

lg elundril

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
thepaine91
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 763
Erhaltene Danke: 27

Win XP, Windows 7, (Linux)
D6, D2010, C#, PHP, Java(Android), HTML/Js
BeitragVerfasst: Mo 23.03.09 11:04 
Hi, versuch mal dir anzugewöhnen zwischendurch "F1" zu drücken,
dann kannst du dir solche Fragen selbst beantworten und wirst selbstständiger.
Das Hilft dabei nicht zu sehr vom Internet abhängig zu sein. =)