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



BeitragVerfasst: Mo 21.03.05 17:29 
Hi wie kann ich machen wenn 3 mal else kommt dass die Antwort in edit1.text kommmt ?
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 21.03.05 17:33 
Könntest Du Deine Frage etwas deutlicher und ausführlicher beschreiben? Jedenfalls habe ich die Frage nicht verstanden.
DelphiDelphin Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 181



BeitragVerfasst: Mo 21.03.05 17:39 
Sory hier noch mal deutlich
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
begin
Showmessage('Richtig')
end else
begin
Showmessage('Falsch')
end;
end;

wie kann ich machen wenn es 3x die Nachricht falsch anzeigt das in Edit1.Text die Lösung kommt zb (hallo)
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Mo 21.03.05 17:43 
Hast du schon mal mit Variablen gearbeitet? ..
ScorpionKing
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1150

Win XP

BeitragVerfasst: Mo 21.03.05 17:43 
du meinst bestimmt falsch eingegeben, oder? :wink:

ausblenden Ein kleiner Code
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
var falsch: integer = 0;

procedure Button1.Click(Sender: Tobject);
begin
if not edit1.text = 'Antwort' then begin
inc(falsch);
end;
if falsch = 3 then
begin
edit1.text := 'Antwort';
end;
end;


MfG, ScorpionKing!

_________________
Aus dem Urlaub zurück!


Zuletzt bearbeitet von ScorpionKing am Mo 21.03.05 17:48, insgesamt 1-mal bearbeitet
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 21.03.05 17:45 
Hallo!

user profile iconDelphiDelphin hat folgendes geschrieben:
wie kann ich machen wenn es 3x die Nachricht falsch anzeigt das in Edit1.Text die Lösung kommt zb (hallo)

Zähle doch einfach in einer Variable mit wie oft der User die Falsche antwort gegeben hat. Also z. B. einfach mit
ausblenden Delphi-Quelltext
1:
WieOftFalsch := WieOftFalsch + 1;					

Und direkt danach prüfst du dann ob die Variable WieOftFalsch gleich 3 ist und gibst die richtge Antwort in dem Edit-Feld aus.

Gruß
Tino
ScorpionKing
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1150

Win XP

BeitragVerfasst: Mo 21.03.05 17:48 
hab ich den code nicht oben schon geschrieben? :wink:

MfG, ScorpionKing!

_________________
Aus dem Urlaub zurück!
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 21.03.05 17:52 
user profile iconScorpionKing hat folgendes geschrieben:
hab ich den code nicht oben schon geschrieben? :wink:

Hast du mal auf die Postingzeiten geschaut? ;-)
ScorpionKing
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1150

Win XP

BeitragVerfasst: Mo 21.03.05 17:54 
ja, habe ich!
mein post ist um 17:43 und deiner um 17:45!

MfG, ScorpionKing!

_________________
Aus dem Urlaub zurück!
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mo 21.03.05 17:55 
Klärt das bitte per PN! Dass die Admins immer so off topic werden müssen! :mrgreen:

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".