//copy的,你改改就行了,可进行混合计算
uses comobj;
function calculate(express:string):string;//进行混合计算的函数
var
vscript:variant;
begin
vscript:=createoleobject('scriptcontrol');
vscript.language:='javascript';
result:=vscript.eval(express);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
edit1.text:=calculate(edit1.text);
end;