Just sharing smaller way than the suggested code I came up with.
Just using it once or twice...
or go big
GLOBAL!
then this where its needed.
Just using it once or twice...
Code:
file = File.Find("Autoplay\\Docs\\", "*", true, false, nil); if (file) then for j,x in pairs(file) do Tree.InsertNode("Tree1", "1", {Text = String.SplitPath(x).Filename,Data = x}); end end
or go big
GLOBAL!
Code:
function Seek(file,tree,pos) if (file) then for j,x in pairs(file) do Tree.InsertNode(tree, pos, {Text = String.SplitPath(x).Filename,Data = x}); end end end
Code:
file = File.Find("Autoplay\\Docs\\, "*.pdf", true, false, nil); Seek(file,"Tree1","1");