Autor Beitrag
Gorthaur
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19

WinXP SP2
Delphi7
BeitragVerfasst: Mo 17.12.07 19:54 
Ich habe mal eine ganz doofe Anfängerfrage, und zwar möchte ich wie der Betreff schon sagt eine in einem Text eingebettete Variable in einem Edit-Feld ausgeben.

Ein Beispiel dafür wäre: "Das Ergebnis lautet 365 Tage". Wobei die Zahl eine Variable und der Rest ein Text wäre.

Ich habe bisher nur mit Virtual Pascal programmiert und muss mich erst in Object Pascal zurechfinden aber in Virtual Pascal hätte ich die Ausgabe so gemacht : writeln('Das Ergebnis lautet ',zahl,' Tage')

Dementsprechend war mein Versuch unter Delphi folgender:

ausblenden Delphi-Quelltext
1:
edit1.text := ('Das Ergebnis lautet' ,inttostr(zahl), ' Tage');					


So funzt es aber nicht...

Schonmal Danke für die Hilfe!

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt
Wolle92
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Mo 17.12.07 19:57 
ausblenden Delphi-Quelltext
1:
Edit1.Text := "Das Ergebnis lautet" + IntToStr(zahl) + "Tage.";					


Also " statt ', keine Klammern, + statt ,...

_________________
1405006117752879898543142606244511569936384000000000.
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 17.12.07 20:01 
Wohl eher so ;-) :
ausblenden Delphi-Quelltext
1:
edit1.text := 'Das Ergebnis lautet' + inttostr(zahl) + ' Tage';					

_________________
We are, we were and will not be.
Wolle92
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Mo 17.12.07 20:23 
achja... tja, wenn man zu viel denkt...

_________________
1405006117752879898543142606244511569936384000000000.
Gorthaur Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19

WinXP SP2
Delphi7
BeitragVerfasst: Mo 17.12.07 21:06 
Vielen Dank für die schnellen Antworten, genau dass wollte ich wissen... Super! :D