调用 VBScript 计算简单的四则混合运算数学题
function Calc(s: string): string; var vScript: Variant; begin vScript := CreateOleObject('ScriptControl'); vScript.Language := 'VBScript'; Result := vScript.Eval(s); end; //调用 var s:string; begin s:=Calc('10*2/5-0.32+5*2/3.15*[(6+5)-3/5]'); ShowMessage(s); end;