自定义的用户对象uo_1, 我是否一定要用create创建此对象实例后,才能用, 哪些情况下无须用create创建呢?多谢

fishead37 2005-03-11 04:00:02
谢谢。
...全文
256 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
aichangfeng 2005-03-12
  • 打赏
  • 举报
回复
可视U0_1不用创建,不可视的就需要因为很多函数已经封装
herrick 2005-03-12
  • 打赏
  • 举报
回复
luotitan(泰坦) 提的没错,
custom class中的属性autoinstantiate勾上的话,
使用的时候就只要声明,不需要创建和释放的过程,这是由系统完成的。
PFC里有很多这种的用户类
mnsiii 2005-03-12
  • 打赏
  • 举报
回复
大家都说得很好嘛!我都没什么好说的了,系统自定义的不用创建,比如sqlca
luotitan 2005-03-11
  • 打赏
  • 举报
回复
autoinstantiate
li_d_s 2005-03-11
  • 打赏
  • 举报
回复
对,visual的三种不用create
hygougou 2005-03-11
  • 打赏
  • 举报
回复
可视的,即有界面的都不用create
fishead37 2005-03-11
  • 打赏
  • 举报
回复
to li_d_s(我是小鬼) :
是不是只要是custom visual 和 standard visual 和external visual这三种创建的用户对象,都无需create呢?
fishead37 2005-03-11
  • 打赏
  • 举报
回复
怎没兄弟帮解答下啊?
j993wf 2005-03-11
  • 打赏
  • 举报
回复
In PowerBuilder, a nonvisual user object can provide functionality similar to that of a structure. Its instance variables form a collection similar to the variables for the structure. In scripts, you use dot notation to refer to the user object's instance variables, just as you do for structure variables.
The user object can include functions and its own structure definitions, and it allows you to inherit from an ancestor class. None of this is possible with a structure definition.
Memory allocation is different for user objects and structures. An object variable is a reference to the object. Declaring the variable does not allocate memory for the object. After you declare it, you must instantiate it with a CREATE statement. Assignment for a user object is also different (described in "Assignment for objects and structures ").

Autoinstantiated objects
If you want a user object that has methods and inheritance but want the memory allocation of a structure, you can define an autoinstantiated object.
You do not have to create and destroy autoinstantiated objects. Like structures, they are created when they are declared and destroyed when they go out of scope. However, because assignment for autoinstantiated objects behaves like structures, the copies made of the object can be a drawback.
To make a custom class user object autoinstantiated, select the Autoinstantiate check box on the user object's property sheet.
li_d_s 2005-03-11
  • 打赏
  • 举报
回复
visual的可视uo不用create,因为你画在窗口上的时候窗口会自动帮你create,其他象custom class和standard class在使用之前都必须create
xyqiqi 2005-03-11
  • 打赏
  • 举报
回复
直接在控件对象中选择此控件

1,108

社区成员

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

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