Autor Beitrag
Caesar44
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 44



BeitragVerfasst: So 17.05.09 21:41 
Hi noch mal an alle,
ich habe noch eine kleine Anfängerfrage:
Wie kann ich eine Schleife mittendrinn beenden wenn der Abbruchwert für die Zählvariable i erreicht wurde?
Sonst wird ja erst am Ende des Schleifendurchlaufs geprüft?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
begin
  x:=100;
  y:=100;
  i:=1;
  Anzahl:= strToInt (edt_AnzahlNiko.Text);
  with image1.canvas do
    begin
      while i<=5+(Anzahl-1)*3
         do begin
          image1.canvas.pixels[x,y]:=clblack;
          Punkt[i]:=Point(x,y);
          inc (i);
          image1.canvas.pixels[x,y+100]:=clblack;
          Punkt[i]:=Point(x,y+100);
          inc (i);
          image1.canvas.Pixels[x+50,y-50]:=clblack ;
          Punkt[i]:=Point(x,y);
          inc (i);
          x:=x+100;
        end;
    end;
end;


Grüße
uall@ogc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: So 17.05.09 22:52 
break;

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit