Autor Beitrag
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Mi 22.09.04 14:37 
Wie kann man eine while Schleife mit Boolean machen?
Wenn ich die Variable auf false setzte wiederholt er sie trotzdem unendlichmal. :?

z.b.
ausblenden Delphi-Quelltext
1:
    while Weiter = true do Weiter := false;					
Tobias1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 454

Win 98, XP Prof
D3 Prof, D2005 Prof
BeitragVerfasst: Mi 22.09.04 14:43 
Probiers mal mit dem Befehl break;
Jörg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 71

Win 2000, Win XP
Delphi 1, 3, 5, 7
BeitragVerfasst: Mi 22.09.04 14:45 
Bei mir funktioniert das. Ist ja auch eine ganz normale while-Schleife, warum sollte die nicht funktionieren? Hast Du den Code-Schnipsel mal getestet?

Jörg.
Tobias1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 454

Win 98, XP Prof
D3 Prof, D2005 Prof
BeitragVerfasst: Mi 22.09.04 14:50 
Hast du vielleicht mehrere Anweisungen hinter do geschrieben und nicht in begin und end;
Wenn du nämlich schreibst:
ausblenden Delphi-Quelltext
1:
2:
3:
while Weiter = true do 
x:=x+1;
Weiter := false;

dann durchläuft die Schleife nur x:=x+1;
Coder Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Mi 22.09.04 15:07 
ah, shit.
Der Code Schnipsel Funktioniert. :wink:
Mist dann liegts wohl doch nich daran :|