其他分享
首页 > 其他分享> > powerbuilder 函数 indirect 的用法

powerbuilder 函数 indirect 的用法

作者:互联网

对象这样的声明能将操作对应对象属性,在给对象置属性的时候自动执行所需要的操作。
我做了个对象例子如下:
使用方法
uo_demo luTemp
luTemp = create uo_demo
//设置属性
luTemp.iInfo = "My Test Info"
//得到属性
MessageBox("Info",luTemp.iInfo)
DESTROY luTemp

$PBExportHeader$uo_demo.sru
forward
global type uo_demo from nonvisualobject
end type
end forward

global type uo_demo from nonvisualobject
end type
global uo_demo uo_demo

type variables
//定义访问属性
public:
INDIRECT string iInfo {of_SetInfo(*value),of_GetInfo()}

private:
string zisInfo
end variables
forward prototypes
public function integer of_setinfo (string asInfo)
public function string of_getinfo ()
end prototypes

public function integer of_setinfo (string asInfo);//Function: of_SetInfo()
IF NOT IsNull(asInfo) THEN
zisInfo = upper(asInfo)
END IF
RETURN 1
end function
public function string of_getinfo ();//Function:of_GetInfo()
Return zisInfo
end function
on uo_demo.create
TriggerEvent( this, "constructor" )
end on

on uo_demo.destroy
TriggerEvent( this, "destructor" )
end on
 

标签:function,luTemp,end,string,powerbuilder,demo,用法,uo,indirect
来源: https://blog.csdn.net/asmfox/article/details/122408500