冰
冰狐狸
Unregistered / Unconfirmed
GUEST, unregistred user!
代码:
我在写程序时, 写了一个类,其中有一属性表示权限字,用32个整形数表示不同的权限,
所以我就想定义数组来存放,是用数组Array [0..31] of Integer存放;但是这个属性却不
能publish,只能在public下,而且当用流对当前类操作时存在该属性中的数据不能导入流;
我的类的定义为,
TRightArr = Array [0..31] of Integer;
TUserInfo = Class(TComponent)
private
...
FRights: TRightArr;
function GetRight(Index: Integer): Integer;
procedure PutRight(Right: Integer; Index: Integer);
public
constructor create;
distructor distory;
procedure LoadFromFile(FileName: string);
procedure SaveToFile(FileName: string);
....
property Rights[Index: Integer]: Integer Write PutRight read GetRight;
...
publish
end;