[sword-devel] breakage in verse management at -r2785?

Troy A. Griffitts scribe at crosswire.org
Mon Mar 11 17:51:00 MST 2013

Thanks Karl,

I just checked in a "showchapter.cpp" example here, which I think 
represents your use case:


It seems to work for me with this execution:

./showchapter jonah.3.1

Could it be the module being used that trips the error?  Or maybe the 
normalization or intros settings on the key?


On 03/12/2013 01:31 AM, Karl Kleinpaste wrote:
> 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" <scribe at 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 at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page

More information about the sword-devel mailing list