如在运行时取得一个自定义对象实例是继承于哪一个用户自定义类

wallis 2003-10-09 12:14:24
定义了用户对象uo_abc
在窗口上建立了一个该对像的实例uo_1,请问如何得到该对象继承于哪个用户对象
例如:
如何在运行时得到uo_1继承预uo_abc
...全文
43 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
编程夜猫 2003-10-09
  • 打赏
  • 举报
回复
可能要这样:
ClassDefinition lcls_par,lcls_this
string ls_parName
lcls_this = uo_1.classdefinition
lcls_par = lcls_this.Ancestor

ls_parName = lcls_par.name
你试试看。

编程夜猫 2003-10-09
  • 打赏
  • 举报
回复
那你就用这个吧。不过我没用过。
ClassDefinition object

The ClassDefinition object lets you check:

1。The name of the class
2。The library the class was loaded from
3。The class definition of its ancestor, if any
4。The class definition of its parent or container object, if any
5。Whether the class is autoinstantiated
6。Whether the class is a system class (defined by PowerBuilder) or a user-defined object (defined in a PowerBuilder PBL)
7。The classes the object contains, such as the controls contained in a window

8。The variables and scripts defined in the class
wallis 2003-10-09
  • 打赏
  • 举报
回复
classname()得到的是uo_1
wallis 2003-10-09
  • 打赏
  • 举报
回复
不要用typeof(),它只能得到userobject!,而我要得到的是uo_abc
编程夜猫 2003-10-09
  • 打赏
  • 举报
回复
是classname()?
还是typeof() ?
忘了,试试吧。

680

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder API 调用
社区管理员
  • API 调用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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