PDA

View Full Version : tree error


jackdaniels
04-23-2008, 10:26 AM
i want to delete a node but i get error when nothing is selected:

SelectedTab = Tree.GetSelectedNode("Tab_Panel");
TabDataTable = Tree.GetNode("Tab_Panel", SelectedTab);
TabText = TabDataTable.Text
if SelectedTab == "1" or SelectedTab == "1.1" then else
Tree.RemoveNode("Tab_Panel", SelectedTab);
end

i get that error when nothing is selected:
http://img159.imageshack.us/img159/2034/errorut0.jpg

RizlaUK
04-23-2008, 10:53 AM
you need to check is there is a select item

try it like this
SelectedTab = Tree.GetSelectedNode("Tab_Panel");
if SelectedTab then
TabDataTable = Tree.GetNode("Tab_Panel", SelectedTab);
TabText = TabDataTable.Text
if SelectedTab == "1" or SelectedTab == "1.1" then else
Tree.RemoveNode("Tab_Panel", SelectedTab);
end
end

and btw, i did read your pm, i'll look into it as soon as i can get back on the pc....kids driven me mad today, lol

jackdaniels
04-23-2008, 11:00 AM
same error but line4 :huh

is it the tree object always giving me errors :rolleyes

TimeSurfer
04-23-2008, 11:18 AM
not the tree persay its the table its not holding any data so u will get that error. [check out the apz i posted in your other thread may provide some insight for ya] but dont count rizla out for he's far better then i am.