Q
qddmh
Unregistered / Unconfirmed
GUEST, unregistred user!
挺急得,大家帮忙!!
1。是否有集合数组这种用法?(如下:)
TLimitStatus = (lsBrowse, lsEdit, lsPrint, lsFTP, lsMail, lsBackUp);
TOperLimit = Set of TLimitStatus
const
OperLimitName: Array[0..5] of String = ('浏览', '编辑', '打印', 'FTP管理', 'Mail管理', '数据库备份');
//这里对动态集合树组复常量,可以吗?
OperLimitValue: Array[0..5] of TOperLimit = ([lsBrowse], [lsEdit], [lsPrint], [lsFTP], [lsMail], [lsBackUp]);
2。纪录中是否可用TStringList类型?如果可以怎样用?
TreeNodeData = record
LimitStatus: TStringList
//?
Classtype: string[2];
myname:string[8] ;
end
3。向下面用动态TReeNode数组是否可以?
var
NodeArray: Array of TTreeNode
//这
ParentNodeArray: Array of TTreeNode
//这
Num: integer;
ParentNum: integer;
Rec2: TUserInfo;
i: integer;
SetTreeNodeValue: PTreeNodeData;
begin
Treeview1.Items.Clear ;
Reset(F);
Num := 0;
ParentNum := 0;
while not Eof(F) do
begin
Read(F, Rec2);
if Num = 0 then
begin
SetLength(NodeArray, Num + 1)
//动态TTreeNode树组是否可以这样用?
NodeArray[Num].Text := Rec2.Text ;
NodeArray[Num].ImageIndex := Rec2.ImageID ;
PTreeNodeData(NodeArray[Num].Data).LimitStatus := Rec2.LimitValue ;
PTreeNodeData(NodeArray[Num].Data).Classtype := Rec2.LimitType ;
PTreeNodeData(NodeArray[Num].Data).Password := Rec2.Password
SetTreeNodeValue^.LimitStatus := Rec2.LimitValue ;
SetTreeNodeValue^.Classtype := Rec2.LimitType ;
SetTreeNodeValue^.Password := Rec2.Password ;
SetLength(ParentNodeArray, ParentNum + 1);
//是否可以将添加的Treeview1子对象存入动态数组中?
ParentNodeArray[ParentNum] := TreeView1.Items.AddObject(nil, Rec2.Text, TObject(SetTreeNodeValue));
ParentNodeArray1 := TreeView1.Items.AddObject(nil, Rec2.Text, TObject(SetTreeNodeValue));
Inc(Num);
Inc(ParentNum);
CurrentLevel := 0;
Continuous := True;
Exit;
end
我运行程序时,总在注释处报错, 高手解释一下, 美分了,45请笑纳。
1。是否有集合数组这种用法?(如下:)
TLimitStatus = (lsBrowse, lsEdit, lsPrint, lsFTP, lsMail, lsBackUp);
TOperLimit = Set of TLimitStatus
const
OperLimitName: Array[0..5] of String = ('浏览', '编辑', '打印', 'FTP管理', 'Mail管理', '数据库备份');
//这里对动态集合树组复常量,可以吗?
OperLimitValue: Array[0..5] of TOperLimit = ([lsBrowse], [lsEdit], [lsPrint], [lsFTP], [lsMail], [lsBackUp]);
2。纪录中是否可用TStringList类型?如果可以怎样用?
TreeNodeData = record
LimitStatus: TStringList
//?
Classtype: string[2];
myname:string[8] ;
end
3。向下面用动态TReeNode数组是否可以?
var
NodeArray: Array of TTreeNode
//这
ParentNodeArray: Array of TTreeNode
//这
Num: integer;
ParentNum: integer;
Rec2: TUserInfo;
i: integer;
SetTreeNodeValue: PTreeNodeData;
begin
Treeview1.Items.Clear ;
Reset(F);
Num := 0;
ParentNum := 0;
while not Eof(F) do
begin
Read(F, Rec2);
if Num = 0 then
begin
SetLength(NodeArray, Num + 1)
//动态TTreeNode树组是否可以这样用?
NodeArray[Num].Text := Rec2.Text ;
NodeArray[Num].ImageIndex := Rec2.ImageID ;
PTreeNodeData(NodeArray[Num].Data).LimitStatus := Rec2.LimitValue ;
PTreeNodeData(NodeArray[Num].Data).Classtype := Rec2.LimitType ;
PTreeNodeData(NodeArray[Num].Data).Password := Rec2.Password
SetTreeNodeValue^.LimitStatus := Rec2.LimitValue ;
SetTreeNodeValue^.Classtype := Rec2.LimitType ;
SetTreeNodeValue^.Password := Rec2.Password ;
SetLength(ParentNodeArray, ParentNum + 1);
//是否可以将添加的Treeview1子对象存入动态数组中?
ParentNodeArray[ParentNum] := TreeView1.Items.AddObject(nil, Rec2.Text, TObject(SetTreeNodeValue));
ParentNodeArray1 := TreeView1.Items.AddObject(nil, Rec2.Text, TObject(SetTreeNodeValue));
Inc(Num);
Inc(ParentNum);
CurrentLevel := 0;
Continuous := True;
Exit;
end
我运行程序时,总在注释处报错, 高手解释一下, 美分了,45请笑纳。