<div>It&#39;s probably easier to create a new TreeKey along the way, otherwise it won&#39;t work properly (going to the parent at the end will lose the place in the sibling iteration).<br> </div>
<div>void getSectionsList(TreeKey tk, list l)<br>{</div>
<div>      do {<br>            l.append (tk-&gt;getText());<br>            if (tk-&gt;hasChildren())<br>            {</div>
<div>                 TreeKey new_tk = tk.clone();<br>                 new_tk-&gt;firstChild();<br>                 getSectionsList(new_tk, l);</div>
<div>                 delete new_tk;</div>
<div>            }<br>       } while (tk-&gt;nextSibling())<br>}</div>
<div> </div>
<div>Untested code, of course...</div>
<div> </div>
<div>God Bless,<br>Ben<br>-------------------------------------------------------------------------------------------<br>Multitudes, multitudes,<br>    in the valley of decision!<br>For the day of the LORD is near<br>    in the valley of decision.<br>
<br>Giôên 3:14 (ESV)<br> </div>
<div><span class="gmail_quote">On 03/11/2009, <b class="gmail_sendername">Matthew Talbert</b> &lt;<a href="mailto:ransom1982@gmail.com">ransom1982@gmail.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">This might be better. I&#39;m probably still missing some logic.<br><br>void getSectionsList(TreeKey tk, list l)<br>
{<br>      l.append (tk-&gt;getText());<br>      if tk-&gt;hasChildren()<br>      {<br>          tk-&gt;firstChild();<br>          getSectionsList(tk, l);<br>      }<br>     while tk-&gt;nextSibling()<br>     {<br>          getSectionsList(tk, l);<br>
     }<br>     tk-&gt;parent();<br>}<br><br>Matthew<br><br>_______________________________________________<br>sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a><br><a href="http://www.crosswire.org/mailman/listinfo/sword-devel">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>
Instructions to unsubscribe/change your settings at above page<br></blockquote></div><br><br clear="all">