And for an arbitrary reference you may have to check the previous verses, too. 

— DM Smith

> On Nov 15, 2018, at 9:05 AM, Greg Hellings <greg.helli...@gmail.com> wrote:
> 
> In the olden days this was detected by incrementing to the next verse, 
> calling renderText(), and doing a string comparison between it and the 
> previous verse to determine if they were the same.
> 
> Nowadays there is a method on SWModule named "isLinked(SWKey*, SWKey*)". It 
> has slightly more complicated logic (it doesn't render out the text, so it's 
> not susceptible to differences in filter and option settings, etc) and should 
> be more efficient than just a string comparison. You can pass it two verse 
> keys and it will tell you if they both point to the same entry or not. You 
> need to keep two copies of two different keys, increment one, ask the module 
> if they're linked. If they are, then keep incrementing one until you get to 
> the next verse that isn't linked. If they are not, then set the base key 
> equal to the incremented key and render out the next verse.
> 
> --Greg
> 
>> On Thu, Nov 15, 2018 at 5:09 AM Peter Von Kaehne <ref...@gmx.net> wrote:
>> How are linked verses practically encoded? 
>> 
>> I would like to fix the diatheke etc at some point to not put out duplicate 
>> verses and I do know that xiphos etc do not do so, so what wouldl I need to 
>> look for?
>> 
>> Thanks
>> 
>> Peter
>> 
>> _______________________________________________
>> sword-devel mailing list: sword-devel@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@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@crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page

Reply via email to