Wartość wyrażenia

unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Button1: TButton;
    Label1: TLabel;
    Edit2: TEdit;
    Label2: TLabel;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  x,l,m:real;
  w:real;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  x:=StrToFloat(Edit1.Text);
  l:=2*x; m:=x+1;
  if x=-1 then Edit2.Text:='error' else
  begin
    w:=l/m;
    Edit2.Text:=FloatToStr(w);
  end;
end;

end.