unit MainForm;

interface

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

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

var
  Form1: TForm1;
  CalcExpr: TCalcExpr;
  vars: array of Extended;

implementation
Uses Interfata;

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  Left := (Screen.Width  - Width ) div 2;
  Top  := (Screen.Height - Height) div 3;
  CalcExpr := TCalcExpr.Create(Self);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
   CalcExpr.Formula := ReadExpr(Edit1);
   PutText(Memo1, FloatToStr(CalcExpr.Calc));
end;

end.
