unit UKlasa;

interface
Uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ExtCtrls;

const cMAX  = 10;
const cWAIT = 1000;

Type

MKlasa = class
private
   Memo  : TMemo;	// tylko wskaźnik, nie usuwać
   cyfra : Integer;

public
   procedure   Counter();
   procedure   Display();
   procedure   Execute();

   constructor Create(parMemo : TMemo);
end;

implementation

constructor MKlasa.Create(parMemo : TMemo);
begin
	cyfra := 0;
   Memo  := parMemo;
end;

procedure MKlasa.Counter();
begin
   Inc(cyfra);	// to samo co cyfra := cyfra + 1;
end;

procedure MKlasa.Display();
begin
   Memo.Lines.Add(IntToStr(cyfra));
end;

procedure MKlasa.Execute();
var
   lp : Integer;

begin
   for lp := 1 to cMAX do
   begin
      Counter();
      Display();

      Sleep(cWAIT);
   end;
end;

end.

