现在我在看powerscript reference 中有一段英文不知如何理解,请帮我看看

yuantianwen 2005-02-04 04:28:54
When passing an object, you never get another copy of the object. By reference
and by value affect the object reference, not the object itself.

Objects passed by value
Here you pass a copy of the reference to the
object. That reference is still pointing to the original object. If you change
properties of the object, you are changing the original object. However, you can
change the value of the variable so that it points to another object without
affecting the original variable.

Objects passed by reference
Here you pass a pointer to the original
reference to the object. Again, if you change properties of the object, you are
changing the original object. You can change the value of the variable that was
passed, but the result is different—the original reference now points to the new
object.
Objects passed as read-only
Here you pass an object as read-only, and you
get a copy of the reference to the object. You cannot change the reference to
point to a new object (because read-only is equivalent to a CONSTANT
declaration), but you can change properties of the object.
...全文
76 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
balloonman2002 2005-02-04
  • 打赏
  • 举报
回复
意思是当你传递一个对象OBJECT时,无论是BYVALUE的值传递还是BYREF的地址传递都是可以直接修改原OBJECT的,而不是说你可以获取一个OBJECT的COPY对象,因为实际传递的并非OBJECT本身,而是传递的这个对象的内存地址的数值,因此所谓的BYVALUE、BYREF都是对这个LONG型地址数值的COPY或直接引用......
剩下的我就不翻译了,相信楼主应该可以理解了......

401

社区成员

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

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