H
harmer
Unregistered / Unconfirmed
GUEST, unregistred user!
我要将下面过程改写为function 为何出错?
原过程:
var o : Olevariant; //name是web中的edit控件,ss为要向web赋的值
begin
o:=form1.webbrowser1.oleobject.document.all.item('name',0);
o.value:='ss';
改写为:
FUNCTION tform1.dj_xx(name,aa:string):boolean;
var o : Olevariant;
begin
try
o:=webbrowser1.oleobject.document.all.item(name,0);
o.value:=aa;
result:=true;
except
result:=false;
end;
end;
调用时:
dj_xx('name','ss'):
我哪里写错了???
原过程:
var o : Olevariant; //name是web中的edit控件,ss为要向web赋的值
begin
o:=form1.webbrowser1.oleobject.document.all.item('name',0);
o.value:='ss';
改写为:
FUNCTION tform1.dj_xx(name,aa:string):boolean;
var o : Olevariant;
begin
try
o:=webbrowser1.oleobject.document.all.item(name,0);
o.value:=aa;
result:=true;
except
result:=false;
end;
end;
调用时:
dj_xx('name','ss'):
我哪里写错了???