<html><head></head><body>Greg is right, but concerning VerseKey objects. The problem with instancing a VerseKey is that it defaults to the KJV v11n system. The module may use another. So, then you need to setVersification appropriately on the newly instantiated VerseKey to access all the verses correctly for the module. The alternative is either to:<br>
<br>
Simply call: SWModule::createKey()<br>
Which will give you back an SWKey appropriate for the module.<br>
<br>
Or simply send strings to SWModule::setKey(...)<br>
<br>
All keys can be reduced to a string representation and each module type will ask its own key representation to deal with the string accordingly.<br>
<br>
In C++, this is allowed in the engine by providing a const char * c-tor on the base of all keys, the SWKey object. Then SWModule::setKey(const SWKey &amp;) will accept strings by constructing a temporary for you.<br>
<br>
module.setKey(&quot;jas.1.18&quot;)<br>
<br>
So, in essense, your C# code to create an SWKey with a string, and then set the module with this key does the same thing, though in multiple steps.<br>
<br>
So, to summarize. Gregs warning about constructing a VerseKey manually is important. You&#39;re not doing this in your example so there&#39;s not danger of using the wrong versification system. I&#39;m not sure if you need to even construct a key at all; i.e., I don&#39;t know if C# will imply the temporary SWKey and simply allow the module.setKey(&quot;jas.1.18&quot;), as C++ provides for.<br>
<br>
Hope this is more help than confusion.<br>
<br>
Troy<br>
-- <br>
Sent from my Android phone with K-9 Mail. Please excuse my brevity.<br><br><div class="gmail_quote">Greg Hellings &lt;greg.hellings@gmail.com&gt; wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre style="white-space: pre-wrap; word-wrap:break-word; font-family: sans-serif">On Sat, Aug 11, 2012 at 9:38 PM, Daniel Hughes &lt;trampster@gmail.com&gt; wrote:<br />&gt; I managed to get it working with the following code:<br />&gt;<br />&gt; using(SWMgr mgr = new SWMgr())<br />&gt; using(SWModule module = mgr.getModule("ESV"))<br />&gt; using(SWKey key = new SWKey("jas 1:18"))<br /><br />In SWORD you should _never_ instantiate an instance of SWKey. You<br />should use the module's methods for fetching its particular instance<br />of the SWKey and set the value using the appropriate methods (or<br />assignment overload in C++).<br /><br />Because each module might have a different versification scheme, the<br />default when you instantiate one is to follow the KJV's versification<br />but that can lead to improper results when assigned to a module that<br />does not use KJV.<br /><br />&gt; {<br />&gt;    module.setKey(key);<br />&gt;    Console.WriteLine
(module.RenderText());<br />&gt; }<br />&gt;<br />&gt; I wouldn't go as far as to say that I have working c# bindings, I only have<br />&gt; a very small subset working. I was planning on publishing what I have on<br />&gt; bitbucket under GPL3.<br />&gt;<br />&gt; I must confess that as a C# developer I have no understanding of how to use<br />&gt; make or how to integrate what I have with the rest of your repository and<br />&gt; build system.<br /><br />If you publish what you have, I can work with you to integrate it into<br />the engine's swig bindings. I have been the "pumpkin holder" for them<br />for a while now as well as for the CMake system that is the main way<br />to build them at present.<br /><br />--Greg<br /><br />&gt;<br />&gt; On Sun, Aug 12, 2012 at 4:22 AM, Peter von Kaehne &lt;refdoc@gmx.net&gt; wrote:<br />&gt;&gt;<br />&gt;&gt; On Sat, 2012-08-11 at 20:25 +1200, Daniel Hughes wrote:<br />&gt;&gt;<br />&gt;&gt; &gt; I'm trying to use sword from c#. I have used
swig to generate a<br />&gt;&gt; &gt; wrapper for just enough of sword to open a module and render some<br />&gt;&gt; &gt; text.<br />&gt;&gt;<br />&gt;&gt; If you have working C# bindings, could you update the existing ones?<br />&gt;&gt; There is a not totally infrequent question on this mailing list for<br />&gt;&gt; those.<br />&gt;&gt;<br />&gt;&gt; That aside, I second the other response. No need to go into the details<br />&gt;&gt; of module construction, if you use SWMgr.<br />&gt;&gt;<br />&gt;&gt; Peter<br />&gt;&gt;<br />&gt;&gt;<br />&gt;&gt;<br />&gt;&gt;<br />&gt;&gt;<hr /><br />&gt;&gt; sword-devel mailing list: sword-devel@crosswire.org<br />&gt;&gt; <a href="http://www.crosswire.org/mailman/listinfo/sword-devel">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br />&gt;&gt; Instructions to unsubscribe/change your settings at above page<br />&gt;<br />&gt;<br />&gt;<br />&gt;<hr /><br />&gt; sword-devel mailing list: sword-devel@crosswire.org<br />&gt; <a
href="http://www.crosswire.org/mailman/listinfo/sword-devel">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br />&gt; Instructions to unsubscribe/change your settings at above page<br /><br /><hr /><br />sword-devel mailing list: sword-devel@crosswire.org<br /><a href="http://www.crosswire.org/mailman/listinfo/sword-devel">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br />Instructions to unsubscribe/change your settings at above page<br /></pre></blockquote></div></body></html>