TO haczcg,
那么请问下面这一段:
procedure TMainForm.FillFolderTreeView;
procedure FillTreeNode(TreeNode: TTreeNode);
var
I, FolderID: Integer;
Node: TTreeNode;
begin
FolderID := Integer(TreeNode.Data);
FolderTinyTable.Filter := 'ParentID=' + IntToStr(FolderID);
FolderTinyTable.Filtered := True;
FolderTinyTable.First;
for I := 0 to FolderTinyTable.RecordCount - 1 do
begin
Node := TreeView.Items.AddChild(TreeNode, FolderTinyTable.FieldByName('Name').AsString);
Node.Data := Pointer(FolderTinyTable.FieldByName('ID').AsInteger);
Node.ImageIndex := 1;
Node.SelectedIndex := 1;
FolderTinyTable.Next;
end;
for I := 0 to TreeNode.Count - 1 do
begin
FillTreeNode(TreeNode.Item);
end;
end;
begin
TreeView.Items.BeginUpdate;
TreeView.Items.Clear;
with TreeView.Items.Add(nil, SAddressBook) do
begin
Data := Pointer(0);
ImageIndex := 0;
SelectedIndex := 0;
end;
FillTreeNode(TreeView.Items[0]);
TreeView.FullExpand;
TreeView.Items.EndUpdate;
TreeView.Items[1].Selected := True;
end;
上面的代码中
FolderID := Integer(TreeNode.Data);
是什么意思,Integer不是整型变量吗,怎么能这么用,请问这是什么意思?
这一个嵌套过程吗?