[sword-devel] module format

Chris Little sword-devel@crosswire.org
Sun, 2 Jul 2000 18:22:09 -0700 (PDT)

The best way to write a VB6 Bible program that uses the SWORD module 
format would be to use a DLL of the SWORD library built for Windows.  I
understand that VB6/7 have faily good methods for calling DLLs.

That doesn't really answer your question though, so....

Modules are composed of 3 file types basically.  There are .conf files
with all the module text markup/introduction/etc. info   And there are
data and index file pairs.  Dictionary/lexicon modules have one data/index
file pair while Bible and commentary modules have 1-3 data/index file
pairs (one per testament, plus the apocrypha that don't actually get used
by SWORD at present).

The data file has all of the text of the module in some markup format like
RTF, GBF, ThML, or just plaintext.  The index file is composed of
pairs of 4-byte little-endian addresses and 2-byte little-endian sizes of
data within the data file.  For example, each verse will require 4 bytes
to indicate its starting address within the file, and 2 bytes to indicate
its lenght.

Lexicon/dictionary modules, IIRC, require that the contents be
alphabetized and that the key be on a separate line from the rest of the

Bible/Commentary modules, in addition to having address/size pairs for
each verse, also have one preceding each chapter, book, testament, and
module, which are reserved for introductions.  They might not be presently
accessible by the SWORD library though.

--Chris Little  

On Mon, 3 Jul 2000, Chris Marsh wrote:

> Hi all,
> Attempting to learn VB6.0, as I will be using it at work in the next few
> months.  As a sample program, I am wanting to create a windows Bible Reader
> using the modules available to Sword.  
> I am having a few problems understanding the layout.  Is there a document
> somewhere that explains how these modules are laid out and the relationships
> between the files?
> Chris Marsh
> Analyst Programmer
> Hansen Corporation
> Ph:	(03) 9843 8438
> Fax:	(03) 9843 8590
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
> This footnote also confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
> www.mimesweeper.com
> **********************************************************************