注册 登录
编程论坛 PowerBuilder

查找代码错误~~

coneth 发布于 2007-05-20 21:41, 987 次点击

我是初学的~~请帮我看看这个怎么出错了~是在红色标记出的错,报的是 error c0031:syntax error
另外这个是建的全局函数,请问一下新建全局函数是在 declare global variables 里建吗??
要是不是,请指点一下!谢谢
int i,j
windowobject lwo
uo_skin lole
//
if not isvalid(awin) then
return -1
end if

//
for i=1 to upperbound(awin.control)
if awin.control[i].typeof()=olecustomcontrol! then
lcd=awin.control[i].classdefinition
if lcd.name="uo_actskn43" then
lole=awin.control[i]
exit
end if
end if
next

try
if isvalid(lole) then
if not fileexists(askin) then
lole.object.removeskin()
return 0
end if
else if not fileexists(askin) then
end if
awin.openuserobject(lole,-200,-200)
end if
catch(runtimeerror r)
return -2
end try

try
awin.control[upperbound(awin.control)+1)]=lole
lole.object.loadskin(askin)
lole.object.applyskin(handle(awin))
catch(oleruntimeerror orte)
return -4
catch(runtime rte)
return -5
end try
return 1

[此贴子已经被作者于2007-5-20 21:42:16编辑过]

3 回复
#2
路過2007-05-21 08:58
在declare -->global variables 建立。
這個代碼在哪個事件裡面寫的:
例:如果在Clicked事件寫的
你可以在help-->help contents 中輸入Clicked,找一下return有哪些值。
#3
coneth2007-05-21 10:48

好的~~谢谢~~我先试试

#4
fyh2007-05-24 22:28
declare global variables 是建立全局
1