[sword-devel] using a zText module

Jonathan Morgan jonmmorgan at gmail.com
Sat Aug 11 01:56:39 MST 2012


Hi Daniel,

I have never gone deep enough into the SWORD API to work with the zText
constructor directly.
However, I would suggest that the more "normal" way of accessing modules is
using the SWMgr class (second part of the primer you link to).  Try
creating an SWMgr and using SWMgr.getModule("ESV") [or whatever the C#
equivalent is].

Jon

On Sat, Aug 11, 2012 at 6:25 PM, Daniel Hughes <trampster at gmail.com> wrote:

> Hi,
>
> I'm trying to use sword from c#. I have used swig to generate a wrapper
> for just enough of sword to open a module and render some text.
>
> I followed the example in the API primer found here:
> http://www.crosswire.org/sword/develop/swordapi/apiprimer.jsp
>
> I downloaded the webster module only to discover that it was zText module
> and not a rawtext module as shown in the  example. So instead I tried to
> use the ESV module (which is also ztext).
>
> However the RenderText() call returns nothing (empty string). Here is the
> code I am using:
>
> SWKey key = new SWKey("jas 1:18");
> zText esv = new zText("modules/texts/ztext/esv", "ESV", "English Standard
> Version");
> esv.setKey(key);
> Console.WriteLine (esv.RenderText());
>
> I noticed that that even if I pass in a folder that does not exist, I
> never get an error, RenderText just carries on returning an empty string. I
> created a wrapper for the .Error() function which always returns 0.
>
> I have tried using an absolute path, a relative path, i've tried using an
> ESV module I downloaded from crosswire and one which I installed using
> Xiphos.
>
> I am the developer of a bible application found in the debian repros and
> would love to add support for sword modules. Any help would be
> greatly appreciated.
>
> Cheers,
> Daniel Hughes
>
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20120811/6b01f74f/attachment-0001.html>


More information about the sword-devel mailing list