procedure TfrmCalc.Button1Click(Sender: TObject); begin try edit1.Text := CalcExpr (edit1.Text); except on h:exception do begin showmessage(h.Message ); end; end; end;
procedure TfrmCalc.Edit1KeyPress(Sender: TObject; var Key: Char); begin if key = #13 then Button1Click(self); end;