--------------------------- Function TreeToText--------------------------
-- Args: --
-- TreeName: The Name of Tree Object. --
--------------------------------------------------------------------------
function TreeToText(TreeName)
TreeName = TreeName or "Tree1";
local a= 0;
local b;
txt="";
function node(t)
local k;
local c;
local NodeIn;
if type(t)=='table'then
for x = 1,#t do
strNodeIndex=t[x].NodeIndex;
k = Tree.GetChildren(TreeName,strNodeIndex);
txt = txt..t[x].Text.."\r\n";
if k then
txt=node(k);
end
end
return txt;
end
end
repeat
b = Tree.GetChildren(TreeName,tostring(a));
if b then
txt=node(b);
break;
end
until b==nil;
return txt;
end
Debug.ShowWindow(true);
Debug.Print(TreeToText("Tree1"));