在编写脚本(pb)时,有时侯pb会自动加入call supper :open()这句代码,这句代码是什么意思,为什么会出现这样的问题?

tiantianpb 2002-03-16 01:19:49
谢谢您的回复!
...全文
783 10 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
pbsql 2002-03-16
  • 打赏
  • 举报
回复
有时窗口的open事件中会莫名其妙地加n个call super::open;确实比较烦人,其实它并不影响程序的运行
pobosskey 2002-03-16
  • 打赏
  • 举报
回复
supers是pb中的代词,
用于 指代
子对象或控件 父类
子窗口或用户对象, 子孙窗口或用户对象的直接祖先
在子窗口或用户对象中的控件 包含该控件的子孙窗口或用户对象的直接祖先

:open指调用父类中的open()
rabbitsfoot 2002-03-16
  • 打赏
  • 举报
回复
Yes!
zhanwei 2002-03-16
  • 打赏
  • 举报
回复
You only see the statement if you export the syntax of the object or look at it in the Source editor.

winwhere 2002-03-16
  • 打赏
  • 举报
回复
写script 的时候,PB会自动加入代码? 我怎么没碰见过
Whyin 2002-03-16
  • 打赏
  • 举报
回复
调用:父类的方法(函数)
call super: 指父类
:open() 父类中的方法
zhanwei 2002-03-16
  • 打赏
  • 举报
回复
The AncestorReturnValue variable is always available in extended event scripts. When you extend an event script, PowerBuilder generates the following syntax and inserts it at the beginning of the event script:
CALL SUPER::event_name
You only see the statement if you export the syntax of the object or look at it in the Source editor.
The following example illustrates the code you can put in an extended event script:
If AncestorReturnValue = 1 THEN
// execute some code
ELSE
// execute some other code
END IF
有没有刚好玩点的?
zhanwei 2002-03-16
  • 打赏
  • 举报
回复
The AncestorReturnValue variable is always available in extended event scripts. When you extend an event script, PowerBuilder generates the following syntax and inserts it at the beginning of the event script:
CALL SUPER::event_name
You only see the statement if you export the syntax of the object or look at it in the Source edit.
The following example illustrates the code you can put in an extended event script:
If AncestorReturnValue = 1 THEN
// execute some code
ELSE
// execute some other code
END IF
有没有更好玩点的?
Eric2000 2002-03-16
  • 打赏
  • 举报
回复
没事,这是继承的原因。删掉或者留着随便你。
llitcwl 2002-03-16
  • 打赏
  • 举报
回复
是继承祖先代码的意思,在PB的源代码中可看到。
但一般不该出现。
如果你选中不执行祖先代码,也可手工加入这句执行祖先代码
相当VC中的
祖先对象::祖先方法();

1,108

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧