blikk info infothek forum galerie sitemap

Überschrift

anfang zurueck weiter ende nach oben
 

   Lösung Aufgabe 1:

   unit Unit1;

  interface

  uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

 type
   TForm1 = class(TForm)
     Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
   i:Integer;
implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
For i:= 1 To 5 Do
Canvas.textout(50,i*20,' Schleife 5mal durchlaufen');
end;

end.






 

Lösung Aufgabe 2:

procedure TForm1.Symbol;
 begin
 with form1.canvas do begin
 pen.width:=2;
 pen.color:=clblack;
 brush.color:=clyellow;
 rectangle(penpos.x+45,penpos.y,penpos.x,penpos.y+40);


 pen.width:=2;
 pen.color:=clgreen;
 brush.color:=clgreen;
 rectangle(penpos.x+15,penpos.y+10,penpos.x+10,penpos.y+15);
 rectangle(penpos.x+35,penpos.y+10,penpos.x+30,penpos.y+15);
 rectangle(penpos.x+35,penpos.y+25,penpos.x+30,penpos.y+30);
 rectangle(penpos.x+10,penpos.y+25,penpos.x+15,penpos.y+38);

 pen.width:=2;
 pen.color:=clblack;
 lineto(penpos.x+22,penpos.y-15);
 lineto(penpos.x+22,penpos.y+15);
 brush.color:=clred;
 floodfill(penpos.x-25,penpos.y-5,clblack,fsborder);

 end;
 end;

procedure TForm1.Button1Click(Sender: TObject);
var zaehler: integer;
begin
with form1.canvas do begin
 rectangle(0,0,form1.width,form1.height);
moveto (20,20);
for zaehler:=1 to 5 do begin
symbol;
moveto(penpos.x-44,penpos.y+82);
sleep(1000);
end; (*of for*)
moveto(220,20);
for zaehler:=1 to 5 do begin
symbol;
moveto(penpos.x-44,penpos.y+82);
sleep(1000);
end; (*of for*)


end;
end;
end.

 


 

 

                                                          (Andrea Loges, Stefanie Brecht, Jakob Thiessen)

 

nach oben
punkt   seitenbereich schließen

Seitentitel



TS-Zählschleife

AS-Zählschleifen