[sword-devel] Where are summaries? Re: How do you select verses from a range?

J H Stovall pythondrs at yahoo.com
Sun Dec 17 17:57:53 MST 2006


Dear Writing Developers,
I read parts of this thread with interest.  The same applies to many
other threads.  I would like to request a summary.

A summary would help some others who do not want to read all of the
posts in order to do the same thing.  Many people have trouble 
sorting through several mistrials in order to find the best solution.
Especially when the bottom line is "setting the key to something else 
solved the problem."  Is there a place with nothing but Solutions?
If there is not, may I suggest that we start one.  Using this list
would be easy.  We could just put Solution in front of each 
Re: [sword-devel] How do you ...?  But I would like to see another
list called [sword-solutions] or better yet a website maybe
crosswire.org/UserSolutions.html  I would also like to request 
that the thread authors or a gifted writer do the postings to 
solutions if such a place already exists or can be established.
Maybe a wiki would be the best place.

Modern linux is not more difficult than Windows.  But it seemed
difficult when I switched primarily because it was rapidly
changing and information necessary to keep up with the changes or
improvements was in so many long trial and error help communities.
As sword expands and improves, we will run into the same problem
unless we have an easy place to get starter information and an
easy place to get howto summaries for added features and 
discoveries.

Thanks to everyone.  You are all doing a great job.  This is just
one suggestion to make it easier for people with learning disabilities
or limited time or the desire to expand sword at a minimum cost
of getting up to speed.

Python, another volunteer

--- Jari Strand <strand_jari at hotmail.com> wrote:

> Troy,
> thank you once again, setting the key to something else solved the problem.
> 
> 
> Jari.
> 
> >From: "Troy A. Griffitts" <scribe at crosswire.org>
> >Reply-To: SWORD Developers' Collaboration Forum <sword-devel at crosswire.org>
> >To: SWORD Developers' Collaboration Forum <sword-devel at crosswire.org>
> >Subject: Re: [sword-devel] How do you select verses from a range?
> >Date: Sat, 16 Dec 2006 00:36:56 -0700
> >
> >Jari,
> >	Looking at your code again...
> >
> > > const char * BibleObject::getVerse(const char *keyStr)
> > > {
> > > 	ListKey result;
> > > 	VerseKey parserKey;
> > >
> > > 	result = parserKey.ParseVerseList(keyStr, parserKey, true);
> > > 	result.Persist(true);
> > >
> > > 	mBible->SetKey(result);
> >
> >this is illegal.  You are telling your mBible to hold on to a locally
> >scoped ListKey result.  As soon as this method is complete, result goes
> >out of scope and your mBible is holding a reference to invalid memory.
> >You have a couple options to fix this.  You can either move result out
> >to mResult, or else book->setKey("gen.1.1") just before returning, to
> >tell book to let go of its persistent key just before it goes out of scope.
> >
> >	Hope this helps,
> >
> >		-Troy.
> >
> >
> >
> >
> > >
> > > 	char* returnBuffer = Con::getReturnBuffer(2024);
> > > 	*returnBuffer = 0;
> > > U32 numCharsInBuffer = 0;
> > >
> > > 	for(*mBible = TOP; !mBible->Error(); (*mBible)++) {
> > > 		const char *ns = mBible->StripText();
> > > 		U32 strLength = dStrlen(ns);
> > > 		if(numCharsInBuffer + strLength >= 2024) {
> > > 			// Verse string was too long and was truncated
> > > 			break;
> > > 		}
> > >
> > > 		dStrcat(returnBuffer,ns);
> > > 		numCharsInBuffer += strLength;
> > >
> > > 	}
> > >
> > > 	return returnBuffer;
> > > }
> > >
> > >
> > > As you can see the result's length is limited. But of course I could and
> > > should use something like std::string and return that but I just wanted 
> >to
> > > make this in the right way.
> > >
> > >
> > >
> > >> Hope this helps.  Glad you're making progress.
> > >>
> > >
> > > It sure does! Thanks.
> > >
> > > It's alright if I can't get a perfect solution for this now that I do 
> >have a
> > > code that works.
> > >
> > >
> > >
> > >
> > > May God bless you too Troy.
> > >
> > > Jari.
> > >
> > >
> > >> 	Blessings!
> > >> 		-Troy.
> > >>
> > >>
> > >>
> > >> Jari Strand wrote:
> > >>> Troy,
> > >>> thank you for the example, I was finally able to test it and it works
> > >> good.
> > >>> But I have one problem, you see when I used to select only one verse I
> > >> could
> > >>> return the string that was returned from RenderText() or StripText() 
> >but
> > >> now
> > >>> that you have to loop in the end in order to get all the strings you
> > >> can't
> > >>> just simply return the results from a function. So is there some other
> > >> way
> > >>> for this so that I don't have to create a return buffer my self?
> > >>> Maybe the loop isn't required if you select verse from a one range and
> > >> not
> > >>> from two or more like in the example?
> > >>>
> > >>> Thanks.
> > >>>
> > >>>
> > >>> Jari.
> > >>>
> > >>>> From: "Troy A. Griffitts" <scribe at crosswire.org>
> > >>>> Reply-To: SWORD Developers' Collaboration Forum
> > >> <sword-devel at crosswire.org>
> > >>>> To: SWORD Developers' Collaboration Forum <sword-devel at crosswire.org>
> > >>>> Subject: Re: [sword-devel] How do you select verses from a range?
> > >>>> Date: Sun, 10 Dec 2006 13:58:47 -0700
> > >>>>
> > >>>> Jari,
> > >>>> 	I've added a new example for you:
> > >>>>
> > >>>>
> > >> 
> >http://crosswire.org/svn/sword/trunk/examples/cmdline/verserangeparse.cpp
> > >>>> 	Please let me know if this does not answer your question.
> > >>>>
> > >>>> 		-Troy.
> > >>>>
> > >>>>
> > >>>>
> > >>>> Jari Strand wrote:
> > >>>>> Hi, is there example showing how to select verses within a range? i
> > >>>> think
> > >>>>> there was some example but I cannot find it anymore.
> > >>>>>
> > >>>>> I only know how to select one verse using setKey("Mat 2:10");
> > >>>>>
> > >>>>> Thanks!
> > >>>>>
> > >>>>> _________________________________________________________________
> > >>>>> FREE pop-up blocking with the new MSN Toolbar - get it now!
> > >>>>> http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
> > >>>>>
> > >>>>>
> > >>>>> _______________________________________________
> > >>>>> 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
> > >>> _________________________________________________________________
> > >>> Express yourself instantly with MSN Messenger! Download today it's 
> >FREE!
> > >>> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> > >>>
> > >>>
> > >>> _______________________________________________
> > >>> 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
> > >
> > > _________________________________________________________________
> > > Express yourself instantly with MSN Messenger! Download today it's FREE!
> > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> > >
> > >
> > > _______________________________________________
> > > 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
> 
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today it's FREE! 
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> 
> 
> _______________________________________________
> 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
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the sword-devel mailing list