LBSH Article: LBSH10.txt
------------------------
 
How do I use LBSH in my own programs?  There are two ways.
 
(1)--Writing an LBSH Help system as a standalone application
 
One way is to build your LBSH Help system as a separate, standalone application.  After it has been debugged and all the content has been created, then it can be "called" from your major application by using the RUN command.  For example, if your Help system starts at the branch label [My.Programs.Help], then your code to call your LBSH Help system would look like this:
 
[My.Programs.Help]
RUN "LBSH.tkn"
 
This is probably the easiest way to deploy LBSH.  It permits the developer to write and debug his application and his Help system independently, without worrying about intertwining the code of one with the code of the other.
 
(2)--Integrating the LBSH Help system into the code of the developer's application.
 
If you elect to import the LBSH code into the code of the primary application, this will not be difficult.  If you look at the source code for LBSH, I have used comment lines to divide it into three sections.
 
The beginning of a section is defined by a comment that looks like this:
 
''''''''Begin Section 1''''''''
 
...while the end of a section is defined by a comment that looks like this:
 
''''''''End Section 1''''''''''
 
The code in Section 1 is used to initialize variables, define arrays, establish your article titles, and list the Help article file names.  Section 1 code should probably be placed near the top of your program.
 
The code in Section 2 sets up the Help window, and defines all the controls for the Help window.  Your application's Help system will probably be activated by a menu command or by a button command, which will direct program control to a certain branch label, such as [My.Programs.Help].  The Section 2 code needs to be copied to a location just below that branch label.
 
Section 3 is a user-defined function, CharacterPosition().  This function is called by the LBSH engine, and returns the location of the last space before the WrapLength, inclusive.  Section 3 code should be copied to wherever you place your user-defined functions, probably at the end of the program.
 