[sword-devel] module making questions

Troy A. Griffitts sword-devel@crosswire.org
Sat, 14 Oct 2000 19:46:41 -0700


> I got the suggestions you gave for solving my second problem to work
> correctly, but I'm still having problems with this first problem.  The
> problem is that I don't see where I have any VerseKey objects in use
> here.  I'm using a RawText class for input, but that seems only to contain
> SWKeys, not VerseKeys, so there's no Headings/AutoNormalize function.
> 
> I tried using
> ((VerseKey)module.Key()).Headings(1);
> ((VerseKey)module.Key()).AutoNormalize(0);
> to access the SWKey inside the module and treat it as a VerseKey but it
> doesn't want to work that way.  Also, I tried using the SWModule's
> decrement operator to go from 1:1 to the introductions, and that also
> failed to work.

I tried also!  It worked fine for me!

j/k  Yep, there seems to be a bug with module headings.  Persisted keys
seem to work, though.  Try this for now until I figure out what's wrong.

          VerseKey vk;
          vk.Headings(1);
          vk.AutoNormalize(0);
          vk.Persist(1);
          mhc->SetKey(vk);

// check to see if it works
          vk = "jas 0:0";
          cout << vk << ":\n";
          cout << (const char *) mhc->Key() << ":\n";
          cout << (const char *) *mhc << "\n";


> 
> Do you have any other ideas that I could try?  I'm tempted to just ignore
> the API and write to the files manually, but would still like to avoid
> that. :)
> 
> Thanks,
> Chris Little