[sword-devel] next chapter / verse in a commentary

Troy A. Griffitts sword-devel@crosswire.org
Mon, 12 Jun 2000 15:24:50 -0700


commentary++;

should give you the next entry in the commentary.  If a commentary has
an entry linked to, say: John 1:1-5 and the key is at John 1:1, a ++ on
the module will force the key to the next entry (NOT John 1:2), like
John 1:6, maybe.  A ++ on the key will go to John 1:2

VerseKey *key = (VerseKey *)(SWKey *)commentary;
key.Chapter(key.Chapter()+1);

should increment from, say John 1:6 to John 2:1, but there may not be an
entry there.  If you want an entry for sure, you could try something
sneaky like:

commentary = MAXVERSE;
commentary++;

or

VerseKey *key = (VerseKey *)(SWKey *)commentary;
key.Verse(1);
commentary--;



Joachim Ansorg wrote:
> 
> Hi Troy!
> 
> A small question about SWORD.
> 
> How can I get the next/previous verse or chapter of a commentary module?
> You know, not every key has an entry.
> 
> Thanks!
> --Joachim