--------------------------- Function Tree.GetNodes-------------------------- -- Args: -- -- TreeName: The Name of Tree Object. -- -------------------------------------------------------------------------- function Tree.GetNodes(TreeName) TreeName = TreeName or "Tree1"; local a= 0; local b; local tb={}; function node(ta) local k; if type(ta)=='table'then for x = 1,#ta do strNodeIndex=ta[x].NodeIndex; k = Tree.GetChildren(TreeName,strNodeIndex); tb[#tb+1]={ Text=ta[x].Text, NodeIndex=ta[x].NodeIndex, Data=ta[x].Data, Selected=ta[x].Selected, Expanded=ta[x].Expanded, Checked=ta[x].Checked, ImageIndex=ta[x].ImageIndex, SelectedImageIndex=ta[x].SelectedImageIndex}; if k then t=node(k); end end return tb end end repeat b = Tree.GetChildren(TreeName,tostring(a)); if b then t=node(b); break; end until b==nil; return t; end t=Tree.GetNodes(TreeName) Debug.ShowWindow(true); Debug.Print(ptbl(t));--table print