Autor Beitrag
ZeroEnna
Hält's aus hier
Beiträge: 9



BeitragVerfasst: Sa 15.04.06 16:37 
Hi liebe Freunde,

ich arbeite freiberuflich bei einem Internet-Radio, und leite da eine Chartssendung.
Jetzzt möchte ich mir einen kleines Proggi basteln, dass mir die arbeit etwas erleichtert.
Ich möchte, dass ich in mehrere Edit-Leisten die Daten wie Interpret, Titel, Chartsposition etc. eingebe und er mir dies in einem Edit ausgibt. Ich möchte dass in einem Edit haben, weil ich dies noch in dem Chat preisgeben muss.
Bisher sieht mein Text so aus:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
Edit6.Text := '/me is currently listeing to' Titel.Text 'by' Artist.Text '. ~Platz' Platz.Text 'der Japan Hit Charts.'
end;

end.


Doch irgendwie funktioniert es nicht, die Titel.Text zwischen zwei Normale Strings einzubetten. Bei QBASIC ging es allerdings, deshalb dachte ich es funzt vielleicht auch in OP/Delphi.
Was muss ich machen da mit es z.B. nachher so aussieht:

Edit6.Text := "'me is currently listening to "Senor Senora Senorita" by Miyavi. ~ Platz 5 der Japan Hit Charts.

Grüße

ZeroEnna

P.S.

In Edit7 (einem weiteren textfeld) soll noch stehen, ob der Interpret und der Titel gegenüber der Vorwoche auf oder abgestiegen ist. Muss ich noch eine Variable festlegfen, die die Werte "gestiegen", "gefallen" oder "geblieben" haben kann? Wenn ja, wie muss ich die definieren?

Moderiert von user profile iconraziel: Quote- durch Delphi-Tags ersetzt
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 15.04.06 16:41 
ausblenden Delphi-Quelltext
1:
Edit6.Text := '/me is currently listeing to'+ Titel.Text+ 'by'+ Artist.Text+ '. ~Platz'+ Platz.Text+ 'der Japan Hit Charts.'					

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
ZeroEnna Threadstarter
Hält's aus hier
Beiträge: 9



BeitragVerfasst: Sa 15.04.06 16:44 
Titel: Re:
Da kriege ich (in Delphi 6) ein Unterminated String.

Habe jetzt herausgefunden warum ^^ danke

und wie kriege ich das mit dem "gestiegen" etc. hin?


Zuletzt bearbeitet von ZeroEnna am Sa 15.04.06 16:46, insgesamt 1-mal bearbeitet
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 15.04.06 16:46 
:gruebel:
Zeig mal bitte nochmal den aktuellen vollständigen Quelltext!

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
ZeroEnna Threadstarter
Hält's aus hier
Beiträge: 9



BeitragVerfasst: Sa 15.04.06 16:47 
user profile iconMarco D. hat folgendes geschrieben:
:gruebel:
Zeig mal bitte nochmal den aktuellen vollständigen Quelltext!


hat sich erledigt ^^

wie nur mit dem "gestiegen, gefallen" etc. mehr muss ich net wissen
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 15.04.06 16:52 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
type
  TSTatus=(gestiegen,gefallen,geblieben);
  ...

var
status:TStatus

//status kann nun die drei Werte annehmen
//Bsp.: if status=geblieben then showmessage('Geblieben');

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
ZeroEnna Threadstarter
Hält's aus hier
Beiträge: 9



BeitragVerfasst: Sa 15.04.06 17:06 
user profile iconMarco D. hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
type
  TSTatus=(gestiegen,gefallen,geblieben);
  ...

var
status:TStatus

//status kann nun die drei Werte annehmen
//Bsp.: if status=geblieben then showmessage('Geblieben');


Alles klar, vielen Dank für deine ünermüdliche Hilfe.....
Eine Sache noch: Kann ich einfach Sagen:

If Edit4.Text > Edit5.Text then TStatus=gestiegen

oder gehtz es net?
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 15.04.06 17:09 
Nein - TStatus ist keine Variable!
Du kannst schreiben:
ausblenden Delphi-Quelltext
1:
2:
var status:TStatus
if edit4.text > edit5.text then status:=gestiegen;

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
ZeroEnna Threadstarter
Hält's aus hier
Beiträge: 9



BeitragVerfasst: Sa 15.04.06 17:14 
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
type
  TStatus = (gestiegen,gefallen,geblieben);
  TForm1 = class(TForm)
    Artist: TEdit;
    Label1: TLabel;
    Titel: TEdit;
    Label2: TLabel;
    Platz: TEdit;
    Label3: TLabel;
    Label4: TLabel;
    Vorwoche: TEdit;
    Label5: TLabel;
    Charts: TEdit;
    Button1: TButton;
    Edit6: TEdit;
    Edit7: TEdit;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  status:Tstatus;
if Platz.text > Vorwoche.text then status:=gefallen;
if Platz.text = Vorwoche.text then status:=geblieben;
if Platz.text < Vorwoche.text then status:=gestiegen;
implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
Edit6.Text := '/me is currently listening to "' + Titel.Text + '" by ' + Artist.Text + '. ~ Platz ' + Platz.Text + ' der Japan Hit Charts.';
Edit7.Text := '/me ergänzt: ' + Titel.Text 'ist von ' + Platz.Text ' auf Platz ' + Vorwoche.Text + Tstatus + ' und seit ' + Charts.Text + 'Wochen in den Charts.';
end;

end.


so sieht mein Programm zur Zeit aus (nach deinen Angaben) aber es will immernoch net funzen...muss ich für Platz.Text und Vorwoche.Text deklarieren, dass es Zahlen sind, bzw. Integer?

Hab früher mal mit Delphi gearbeitet bin aber mitlerweile schon wieder etwas raus.
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 15.04.06 17:21 
Was heißt, nicht funktionieren?
Fehlermeldungen?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 15.04.06 17:23 
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
type
  TStatus = (gestiegen,gefallen,geblieben);
  TForm1 = class(TForm)
    Artist: TEdit;
    Label1: TLabel;
    Titel: TEdit;
    Label2: TLabel;
    Platz: TEdit;
    Label3: TLabel;
    Label4: TLabel;
    Vorwoche: TEdit;
    Label5: TLabel;
    Charts: TEdit;
    Button1: TButton;
    Edit6: TEdit;
    Edit7: TEdit;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  status:Tstatus;
if Platz.text > Vorwoche.text then status:=gefallen;
if Platz.text = Vorwoche.text then status:=geblieben;
if Platz.text < Vorwoche.text then status:=gestiegen;

//HAST DU SOWAS WIE EINEN AUSWERTEN-BUTTON? DAS MUSS BESTIMMT IN DIE ONCLICK PROZEDUR
//HIER IST DAS FALSCH!!!
implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
Edit6.Text := '/me is currently listening to "' + Titel.Text + '" by ' + Artist.Text + '. ~ Platz ' + Platz.Text + ' der Japan Hit Charts.';
Edit7.Text := '/me ergänzt: ' + Titel.Text 'ist von ' + Platz.Text ' auf Platz ' + Vorwoche.Text + Tstatus + ' und seit ' + Charts.Text + 'Wochen in den Charts.';

end;

end.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
ZeroEnna Threadstarter
Hält's aus hier
Beiträge: 9



BeitragVerfasst: Sa 15.04.06 17:25 
user profile iconMarco D. hat folgendes geschrieben:
Was heißt, nicht funktionieren?
Fehlermeldungen?


Zeile 47:

ausblenden Delphi-Quelltext
1:
Edit7.Text := '/me ergänzt: ' + Titel.Text ' ist von Platz'(*) + Platz.Text + 'auf Platz ' + Vorwoche.Text + Tstatus + (**) ' und seit ' + Charts.Text + 'Wochen in den Charts.';					


Bei (*): Missing Operator or Semicolon
Bei (**): "(" expected, but "+" found

Das sind die Fehler in dieser Zeile
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 15.04.06 17:29 
** -->Du kannst TStatus nicht mit einem String verknüpfen.
* --> keine Ahnung :nixweiss:

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
ZeroEnna Threadstarter
Hält's aus hier
Beiträge: 9



BeitragVerfasst: Sa 15.04.06 17:30 
user profile iconMarco D. hat folgendes geschrieben:
** -->Du kannst TStatus nicht mit einem String verknüpfen.
* --> keine Ahnung :nixweiss:


**: Wie kann ich das Problem lösen
*: Okay ^^
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 15.04.06 17:33 
Du nimmst TStatus wieder weg^^
--> Ich dachte, du brauchst es nur zur Abfrage.
Stattdessen nimmst du eine String-Variable und speicherst dort entweder 'geblieben', 'gefallen' usw. und so kannst du es auch abfragen, neu setzen und ganz einfach in dein Edit schreiben. ;)

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Sa 15.04.06 17:41 
ausblenden Delphi-Quelltext
1:
Titel.Text + ' von Platz' ... // Achtung: Bei den '...' Könnte undefinierter Bezeichner kommen :P					

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
ZeroEnna Threadstarter
Hält's aus hier
Beiträge: 9



BeitragVerfasst: Sa 15.04.06 17:52 
user profile iconMarco D. hat folgendes geschrieben:
Du nimmst TStatus wieder weg^^
--> Ich dachte, du brauchst es nur zur Abfrage.
Stattdessen nimmst du eine String-Variable und speicherst dort entweder 'geblieben', 'gefallen' usw. und so kannst du es auch abfragen, neu setzen und ganz einfach in dein Edit schreiben. ;)


klingt ja super kompliziert....aber ich weiß jetzt wie, vielen dank für deine unermüdliche hilfe!