[sword-devel] Faster searching wanted

Nathan sword-devel@crosswire.org
Mon, 1 Apr 2002 13:50:11 -0700

Oh. Hm. That looks like a lot of code. I currently go like this: -)

VerseKey key = [bookName cString];
maxChapters = key.books[key.Testament()-1][key.Book()-1].chapmax;

So I should use CreateKey:
VerseKey *key = (VerseKey *)kjvmod.CreateKey();
then some SetKey() function to set the book.
then my maxChapters code
then delete the key.

Or, I suppose I could set the key to MAXCHAPTER and then get what it 
is with Chapters() like you do. (Except I'm only grabbing info on one 
at a time).

But it would be kind of nice to have a MaxChapters() method in the 
API, don't you think :-).

Now - if I understand correctly - the module doesn't control the 
locale used by getBookName() - but I can specify the the locale in 
the key I create, and I can retrieve the locale used by the module - 
depending if the user wants the interface text to match the module in 
use, or use their system-wide preferences.

Naturally I encapsulated the code I need in a SwordBible Objective-C 
class - so it's pretty easy to change things like how maximum chapter 
counts are retrieved.

- n8

Nathan Youngman
E-mail: nathany at mac.com
Web: http://nathany.com