<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">And for an arbitrary reference you may have to check the previous verses, too. <br><br><div dir="ltr">— DM Smith</div><div dir="ltr"><br>On Nov 15, 2018, at 9:05 AM, Greg Hellings <<a href="mailto:greg.hellings@gmail.com">greg.hellings@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div dir="ltr"><div dir="ltr">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.<div><br></div><div>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.</div><div><br></div><div>--Greg</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 15, 2018 at 5:09 AM Peter Von Kaehne <<a href="mailto:refdoc@gmx.net">refdoc@gmx.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">How are linked verses practically encoded? <br>
<br>
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?<br>
<br>
Thanks<br>
<br>
Peter<br>
<br>
_______________________________________________<br>
sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org" target="_blank">sword-devel@crosswire.org</a><br>
<a href="http://www.crosswire.org/mailman/listinfo/sword-devel" rel="noreferrer" target="_blank">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>
Instructions to unsubscribe/change your settings at above page<br>
</blockquote></div>
</div></blockquote><blockquote type="cite"><div dir="ltr"><span>_______________________________________________</span><br><span>sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a></span><br><span><a href="http://www.crosswire.org/mailman/listinfo/sword-devel">http://www.crosswire.org/mailman/listinfo/sword-devel</a></span><br><span>Instructions to unsubscribe/change your settings at above page</span></div></blockquote></body></html>