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?
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