WinHelp Database Publishing with MiniHelp Plus
A Tutorial by John C. Reynolds III
This is Part 4 of 6 (Create Help File Descriptors)

Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6

TASK 3: Automatically Create Help File Descriptors

This part of the tutorial provides examples of Access Basic code that will automatically create the help file descriptors Topic ID, Browse Sequence, and Search Keywords. Three Access Basic "Sub" procedures that will accomplish this are provided for your examination: btnSelect_Click(), btnBrowse_Click(), and btnKeywords_Click().

btnSelect_Click()

The coding in btnSelect_Click() takes all records from an imported database table and puts them into an empty table, where they can be sorted and given unique Topic IDs based on last names. The procedure is fairly well-commented, so you should be able to follow it, given you have some experience with Access Basic (or the newer script language for Access, Visual Basic for Applications, or VBA).

See also:

btnBrowse_Click()

Next, the coding in btnBrowse_Click() goes through each record [after they've been properly sorted in a table by the previous procedure, btnSelect_Click()] to assign sequential Browse Sequence numbers to each person's record in the phone book database, complete with preceding zeroes (e.g., 0005, 0006, ... 0099, 0100, etc.).

The starting Browse Sequence number is defined by a global constant, gconSTART_IND_BROWSNUM, which I've defined in a separate module. In the procedure btnBrowse_Click(), the variable UtilInt0 is given the starting number from the global constant gconSTART_IND_BROWSNUM so the procedure can then use it as a starting point. I did this because I have several other topics that I wanted to precede the individual topics for each person in the phone book. (These preceding topics can include such items as organizational policy and procedures, meeting calendars, etc., and the number of preceding topics could change in quantity).

TIP: It's useful to maintain certain items as global constants, especially if they might change. Doing this makes it easier to update multiple references to a constant because you can do the updating from one place, instead of searching through all parts of a procedure (or multiple procedures). Another example of this technique is to use a global constant for the string value that holds the path where MiniHelp Plus is located on the hard drive (i.e., where you you want the database to write the WinHelp source files). At home, I have an older version of MiniHelp Plus on the F: drive, and at work it's on the C: drive. So, when I take my database to and fro, I have a module called "Portable" in which I've defined the global constant gconPBOOKHLP_A_PATH. When I'm at home, I change that constant to "F:\MHPLUS32", and when I'm at work, I change it to "C:\MHPLUS35".

See also:

btnKeywords_Click()

The last coding example, from btnKeywords_Click(), automatically builds Search Keywords. Each person's record in the phone book database is examined for last name, first name, and company. Then string concatenation is used to put all of these together for an individual's assigned Search Keywords.

To build the complete list of Search Keywords for a single person, each search keyword phrase is separated from the next by a semi-colon (;) character. So, if a person entered in the database has these attributes:

... the routine btnKeywords_Click() will join those variables into one string as follows:

That string of Search Keywords will then be placed into the Search_Words field of the database table. Later, under the direction of a different procedure, the Search Keywords are written into the source file for MiniHelp Plus as a ".keyword" entry for that person's topic.

See also:

[<<] PREV | NEXT [>>]
This is Part 4 of 6 (Create Help File Descriptors)

Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6

©1997 John C. Reynolds III - last updated 1997 November 20
http://www.compassnet.com/jreynold/whdb_3.htm
is a registered trademark for Daniel Industries, Inc.