unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Button2: TButton;
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
begin
 i:=0;
 repeat
   if (Memo1.Lines[i]='a')and (Memo1.Lines.Count>0) then
     Memo1.Lines.Delete(i) else  i:=i+1;
 until i=Memo1.Lines.Count;  //liczba linii zmniejsza się po każdym kasowaniu
 Memo1.SetFocus;
end;

procedure TForm1.Button2Click(Sender: TObject);
var i:integer;
    j:single;
begin
 i:=0;
 repeat
   try
     j:=StrToFloat(Memo1.Lines[i]);
     i:=i+1;
   except
     Memo1.Lines.Delete(i);
   end;
 until i=Memo1.Lines.Count;
 Memo1.SetFocus;
end;

end.
