Regrets for not following up until this evening; I can send mail here
only from home, being firewalled at the office these days.

"Troy A. Griffitts" <scr...@crosswire.org> writes:
> Do you have an idea of how you are using versekey? 
> When you display a chapter, are you iterating on the key or on the module? 

The essential code is:

    VerseKey *key = (VerseKey *)(SWKey *)imodule;
    int curVerse = key->getVerse();
    int curChapter = key->getChapter();
    int curBook = key->getBook();

    for (key->setVerse(1);
         (key->getBook()    == curBook)    &&
         (key->getChapter() == curChapter) &&
         !imodule.popError();
         imodule++) {
         /* ... lots of hacking based on current key ... */
    }

I've been wondering literally for years why key is typecast twice, from
module through SWKey to VerseKey, but this code predates my presence and
there's actually quite a lot that I've learned to accept somewhat
uncritically.  If there is a better way to loop through this, by all
means re-educate me.

--karl

_______________________________________________
sword-devel mailing list: sword-devel@crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page

Reply via email to