| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| How can I use the iteration mechanism to iterate through a tree? Is CURSOR_TREE_ITERATOR the right class? The following does not compile because iterator expects the type CURSOR_TREE [BINARY_SEARCH_TREE [INTEGER_32]]. class APPLICATION create make feature -- Initialization make is -- Run application. local tree: BINARY_SEARCH_TREE [INTEGER] iterator: CURSOR_TREE_ITERATOR BINARY_SEARCH_TREE [INTEGER]] do create tree.make (500) tree.put (400) tree.put (600) create iterator iterator.set (tree) end end -- class APPLICATION There must be a simple solution without requiring the client programmer to build his own class inheriting from the deferred class CURSOR_TREE, isn't it? Thx |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.