[sword-devel] Prevent setKey from 'Leaking' into overlapping chapters/books

Troy A. Griffitts scribe at crosswire.org
Sat Jul 16 09:08:23 MST 2011


Sorry, infinite loop typo...
On 16/07/11 17:56, Troy A. Griffitts wrote:
> // show a context window
> int contextWindow = 5;
- for (verseKey-=(contextWindow/2); !verseKey.Error() && contextWindow;
verseKey++) ...
+ for (verseKey-=(contextWindow/2); !verseKey.Error() && contextWindow;
verseKey++,contextWindow--) ...

-Troy



> 
> // show previous chapter
> verseKey.setChapter(verseKey.getChapter() - 1)
> ...
> 
> etc.
> 
> 
> Regarding more API help and more examples.  There is some documentation
> pulled from the comments in the code as doxygen here (but not as concise
> or helpful for a beginner as could be):
> 
> http://www.crosswire.org/~ghellings/1_6_2classdocs/
> 
> But I think your best bet is the examples/ and tests/ directory in the
> source tree.
> 
> If there is an example you would like to see, please shout and we can
> write one up together and improve the resources of example out.
> 
> Troy
> 
> 
> 
> 
> 
> 
> On 16/07/11 17:36, Alex S wrote:
>> Hi folks,
>>
>> I'm just getting started with Sword, and Im working through the included examples. How can I prevent the verse parser from mapping a non valid reference to the next logical book/chapter?
>>
>> For example if I run verserangeparse (in /examples) with "jn22:1" I get acts 1:1, which is the next logical chapter/verse since jn22 doesn't exist. 
>>
>> Verserangeparse jn243:1 yields revelation 22:1
>>
>> Any help? Sorry for the noob question...
>>
>> Also, is there more extensive API documentation than the API primer on the crossword site?
>>
>>
>> Regards,
>> Alex
>>
>>
>>
>> _______________________________________________
>> 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
> 
> 
> _______________________________________________
> 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