If you write a recursive function and do a
ll_tvi_parenthandle = tv_list.FindItem(ParentTreeItem!, ll_tvi_current)
then the FindItem() function returns -1 if ll_tvi_current is a root.
All about the treeview control is pretty good documented in the PowerBuilder Help about "Treeview Control".
hth
Arnd