Autor Beitrag
DelphiDelphin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 181



BeitragVerfasst: So 20.03.05 11:00 
Habe keine Ahnung was daran Falsch ist

ausblenden Delphi-Quelltext
1:
2:
3:
4:
a:= StrtoFloat(Label1.Caption);
b:= StrtoFloat(Label2.Caption);
ergebnis:= a+b;
IF Edit1.Text:= Floattostr(ergebnis) then Showmessage('Gut');


Die Letzte Linie wird immer rot markiert also die mit dem If hat mir jemand einen guten Rat


Moderiert von user profile iconChristian S.: Topic aus Sonstiges verschoben am So 20.03.2005 um 11:01
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: So 20.03.05 11:02 
Du verwendest eine Zuweisung: IF Edit1.Text:= Floattostr(ergebnis) then Showmessage('Gut');

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
DelphiDelphin Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 181



BeitragVerfasst: So 20.03.05 11:04 
Dhx noch mal ne Frage wie kann ich machen dass es eine Nachricht zeigt wenn Eingabe nicht Ergebnis ist??
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: So 20.03.05 11:06 
Neue Frage :arrow: neue Thread

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Mo 21.03.05 10:06 
Wieso neuer Thread, gehört doch zum Thema.
Das machst du dann am besten mit "else".

a := strtoint(Label1.caption);

if a = 1 then
begin
ShowMessage('das ist eine 1');
end //Vor einem "else" darf kein Semikolon stehen
else
begin
ShowMessage('das ist keine 1')
end;