Thema: Delphi schleife

Einzelnen Beitrag anzeigen

Benutzerbild von everdream
everdream

Registriert seit: 22. Feb 2007
Ort: Hiddenhausen
192 Beiträge
 
Delphi 2005 Personal
 
#6

Re: schleife

  Alt 11. Apr 2008, 15:03
Zitat von matze222:
Delphi-Quellcode:
[...]
if (c>10) and(c<20) then
  edit7.Text:=floattostr(e+1);
c:=(c-10);
if (c>5) and(c<10) then
  [...]
2 Fragen dazu:
1.) Meinst wirklich
Delphi-Quellcode:
if (c>10) and(c<20) then
  edit7.Text:=floattostr(e+1);
c:=(c-10);
oder eher
Delphi-Quellcode:
if (c>10) and(c<20) then
begin
  edit7.Text:=floattostr(e+1);
  c:=(c-10);
end;
?

2.) Während deiner Abrfragen wird c schon verändert. Ich bin mir nicht sicher ob das das ist, was du willst.
Soll das Programm je nachdem, wie groß c ist, etwas machen, oder soll is (wie du es im moment hast) c abfragen, dann etwas mit einem edit.Text machen, dann c (oder auch mal d) verändern und dann erst die nächste abfrage starten?

Achso, und bei deinem Code darf c z.B. nicht =10 sein (du fragst einmal auf c > 10 und einmal auf c < 10 ab, aber nie = oder <= oder >=10).

Ich denke auch, dass case c of das richtige für dich ist...
Max
"Das Ziel ist im Weg!"
  Mit Zitat antworten Zitat