调用javaScript脚本计算字符串表达式

uses comobj

 

function calculate(express: string): string;
var
 vscript: Variant;
begin
 vscript := createoleobject('scriptcontrol');
 vscript.language:='javascript';
 result := vscript.eval(express);
end;

posted @ 2008-09-26 09:13  delphi中间件  阅读(343)  评论(0编辑  收藏  举报