Re: wxEuphoria: get_next_tree_child() Returning 0 For All Child Items

new topic     » goto parent     » topic index » view thread      » older message » newer message
euphoric said...

In the following code, get_next_tree_child() is always returning 0. That doesn't seem right.

It seems like I'm using those functions properly, but the results aren't what's expected.

These first/next functions are basically iterators. That is, the "next" function gives elements until the list is exhausted, then it returns NULL. The consumer (you) doesn't need to know how many elements are in the list.

Do it like this:

-- user has selected a category; uninstall all forms in list 
atom indx = get_tree_selection( tree_Templates ) 
 
atom item, cookie 
sequence list = {} 
 
-- Euphoria 4.1 supports multiple assignments 
{item,cookie} = get_first_tree_child( tree_Templates, indx ) 
 
while item do 
    list = append( list, item ) 
    item = get_next_tree_child( tree_Templates, indx, cookie ) 
end while 

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu