F
fuzhong
Unregistered / Unconfirmed
GUEST, unregistred user!
var
str_Y :string;
str_X :string;
script:OleVariant;
s :string;
begin
script := createOLEObject('ScriptControl');
script.language := 'JScript';
str_y := ' function fun(x){result =sqr(x)+x ;return result;};';
script.addCode(str_y);
str_x:=inputbox('','请输入变量','');
ShowMessage(script.run('fun',str_x));
end;
错误提示 缺少对象
各位大人 给修改修改。
str_Y :string;
str_X :string;
script:OleVariant;
s :string;
begin
script := createOLEObject('ScriptControl');
script.language := 'JScript';
str_y := ' function fun(x){result =sqr(x)+x ;return result;};';
script.addCode(str_y);
str_x:=inputbox('','请输入变量','');
ShowMessage(script.run('fun',str_x));
end;
错误提示 缺少对象
各位大人 给修改修改。