home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft_Programmers_Library.7z / MPL / msc / proadv.txt < prev    next >
Encoding:
Text File  |  2013-11-08  |  107.0 KB  |  2,582 lines

  1.  Microsoft  Professional Advisor - LIBRARY REFERENCE
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  ────────────────────────────────────────────────────────────────────────────
  11.             Microsoft (R) Professional Advisor - LIBRARY REFERENCE
  12.  
  13.  
  14.  ────────────────────────────────────────────────────────────────────────────
  15.  
  16.  
  17.                         FOR MS (R) OS/2 and MS-DOS (R)
  18.                               OPERATING SYSTEMS
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  MICROSOFT CORPORATION
  28.  
  29.  Information in this document is subject to change without notice and does
  30.  not represent a commitment on the part of Microsoft Corporation. The
  31.  software described in this document is furnished under a license agreement
  32.  or nondisclosure agreement. The software may be used or copied only in
  33.  accordance with the terms of the agreement. It is against the law to copy
  34.  the software on any medium except as specifically allowed in the license or
  35.  nondisclosure agreement. No part of this manual may be reproduced or
  36.  transmitted in any form or by any means, electronic or mechanical, including
  37.  photocopying and recording, for any purpose without the express written
  38.  permission of Microsoft.
  39.  RESTRICTED RIGHTS: Use, duplication, or disclosure by the U.S. Government is
  40.  subject to restrictions as set forth in subparagraph (c)(1)(ii) of the
  41.  Rights in Technical Data and Computer Software clause at DFARS 252.227-7013
  42.  or subparagraphs (c)(1) and (2) of Commercial Computer Software
  43.  ─Restricted Rights at 48 CFR 52.227-19, as applicable.
  44.  Contractor/Manufacturer is Microsoft Corporation, One Microsoft Way,
  45.  Redmond, WA  98052-6399.
  46.  
  47.  
  48.  (C) Copyright Microsoft Corporation, 1990. All rights reserved.
  49.  
  50.  
  51.  Printed in the United States of America.
  52.  
  53.  
  54.  Microsoft, MS, MS-DOS, CodeView, and QuickC
  55.  are registered trademarks of Microsoft Corporation.
  56.  
  57.  Apple and Macintosh are registered trademarks of Apple
  58.  Computer, Inc.
  59.  
  60.  IBM is a registered trademark of International Business
  61.  Machines Corporation.
  62.  
  63.  
  64.  
  65.  Document No. LN18160-0990
  66.                           OEM D/0711-1Z
  67.  
  68.  10 9 8 7 6 5 4 3 2 1
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  Introduction
  77.  
  78.  Chapter 1  The Help Database
  79.  
  80.       1.1   QuickHelp ASCII
  81.              1.1.1    Formatting Flags
  82.              1.1.2    Cross-References
  83.              1.1.3    QuickHelp Example
  84.       1.2   Minimally Formatted ASCII
  85.       1.3   Unformatted ASCII
  86.       1.4   RTF ASCII
  87.              1.4.1    RTF Example
  88.              1.4.2    Local Contexts
  89.       1.5   Physical Database Organization
  90.              1.5.1    Concatenated Order
  91.              1.5.2    Decompressed Topic Format
  92.       1.6   The Encoding Process
  93.  
  94.  Chapter 2  Text Structure and Conventions
  95.  
  96.       2.1   Authoring the Help Database
  97.              2.1.1    QuickHelp Format
  98.              2.1.2    RTF Format
  99.       2.2   Hotspots and Cross-References
  100.       2.3   Topic Commands
  101.       2.4   Cross-Reference Commands
  102.       2.5   Context Conventions
  103.              2.5.1    Contexts Covered by Convention
  104.              2.5.2    Required Contexts
  105.              2.5.3    Recommended Contexts
  106.              2.5.4    Product-Specific Contexts
  107.       2.6   Hierarchical Contexts
  108.       2.7   Environment Support
  109.  
  110.  Chapter 3  The HELPMAKE Program
  111.  
  112.       3.1   HELPMAKE Options
  113.              3.1.1    Encoding Options
  114.              3.1.2    Other HELPMAKE Options
  115.  
  116.  Chapter 4  Applications Interface
  117.  
  118.       4.1   Defining the Interface
  119.       4.2   Base File Management
  120.       4.3   Context String Management
  121.       4.4   Topic Look-Up and Decompression
  122.       4.5   Context Maneuvering
  123.       4.6   Topic Display
  124.       4.7   Cross-References
  125.       4.8   Utility
  126.       4.9   Help Engine Callbacks
  127.       4.10  Interface Usage
  128.  
  129.  Chapter 5  Size and Performance
  130.  
  131.       5.1   Help Engine
  132.       5.2   HELPMAKE.EXE
  133.  
  134.  Glossary
  135.  
  136.  
  137.  
  138.  Introduction
  139.  ────────────────────────────────────────────────────────────────────────────
  140.  
  141.  The Microsoft(R) Professional Advisor Library Reference contains information
  142.  about the help library supplied with Microsoft C products. There are several
  143.  advantages to using the Advisor Help Library.
  144.  
  145.  Speed and Maneuverability - The help desired by the user must be available
  146.  quickly, with a minimum of user decisions and selections. To achieve this
  147.  goal, the Advisor Help Library supports cross-referencing, context
  148.  sensitivity, preserves previous help activity, and flexible help-text
  149.  organization.
  150.  
  151.  Modification - Users and/or application developers need to be able to add
  152.  help text to the help system and modify existing help text to suit their
  153.  applications and environments. To meet this need, a maintenance utility
  154.  performs both compression and decompression of help files. Also, the Advisor
  155.  Help Library provides the ability to read uncompressed ASCII text as a help
  156.  file.
  157.  
  158.  Integration - The help text presented must be available to outside
  159.  applications. The Advisor Help Library provides support routines necessary
  160.  to allow the application to access this valuable help text.
  161.  
  162.  Size - It is important to create help files that take up minimal disk space
  163.  but do not at the same time severely impact look-up speed. The Advisor Help
  164.  Library provides three compression algorithms to reduce disk space and meet
  165.  speed requirements.
  166.  
  167.  The Advisor Help Library includes the following files:
  168.  
  169.  File Name                         Description
  170.  ────────────────────────────────────────────────────────────────────────────
  171.  HELPMAKE.EXE                      Bound Help-File-Maintenance Utility.
  172.  
  173.  MSHELP.DLL                        OS/2 help engine in DLL form.
  174.  
  175.  MSHELP.LIB                        OS/2 help engine export library.
  176.  
  177.  MHELP.LIB                         Medium-model help engine.
  178.  
  179.  MHELPH.LIB                        Medium-model help engine using
  180.                                    handle:offset.
  181.  
  182.  LHELP.LIB                         Large-model help engine.
  183.  
  184.  WHELPP.LIB                        SS!=DS help engine, protected mode.
  185.  
  186.  WHELPR.LIB                        SS!=DS help engine, real mode.
  187.  
  188.  HELP.H                            Help engine include file. All
  189.                                    applications should
  190.                                    use this.
  191.  
  192.  MSHELP.DEF                        .DEF file for applications that can use
  193.                                    it.
  194.  
  195.  SHELP.LIB                         Small-model help engine.
  196.  
  197.  ────────────────────────────────────────────────────────────────────────────
  198.  NOTE
  199.  
  200.  The pages that follow use the term "OS/2" to refer to the OS/2
  201.  systems─Microsoft Operating System/2 (MS(R) OS/2) and IBM(R) OS/2.
  202.  Similarly, the term "DOS" refers to both the MS-DOS(R) and IBM Personal
  203.  Computer DOS operating systems. The name of a specific operating system is
  204.  used when it is necessary to note features that are unique to the system.
  205.  
  206.  ────────────────────────────────────────────────────────────────────────────
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  Chapter 1  The Help Database
  214.  ────────────────────────────────────────────────────────────────────────────
  215.  
  216.  There are four types of format text for the topical contents of the help
  217.  database:
  218.  
  219.  ASCII Format                      Description
  220.  ────────────────────────────────────────────────────────────────────────────
  221.  QuickHelp                         Default source format for compressed
  222.                                    databases
  223.  
  224.  Minimally formatted               Can be either compressed or read
  225.                                    directly from the help engine
  226.  
  227.  RTF                               An alternate source for the compressed
  228.                                    database
  229.  
  230.  Unformatted                       For use directly by the help engine
  231.  
  232.  
  233.  1.1  QuickHelp ASCII
  234.  
  235.  QuickHelp uses "dot" commands and embedded formatting characters to convey
  236.  information to HELPMAKE. For example:
  237.  
  238.    .context
  239.  
  240.  Each topic is preceded by one or more .context commands that indicate the
  241.  context string for the following topic text up to the next .context line.
  242.  More than one .context command may be specified for a single topic, if no
  243.  topic text is placed between them. For more information on topic commands,
  244.  see Section 2.3 in Chapter 2, "Text Structure and Conventions."
  245.  
  246.  
  247.  1.1.1  Formatting Flags
  248.  
  249.  The following flags may be embedded in the text to change the attributes of
  250.  the topic text:
  251.  
  252.  Formatting Flag                   Action
  253.  ────────────────────────────────────────────────────────────────────────────
  254.  \b or \B                          Bold
  255.  
  256.  \i or \I                          Italic
  257.  
  258.  \p or \P                          Plain
  259.  
  260.  \u or \U                          Underline
  261.  
  262.  \v or \V                          Invisible
  263.  
  264.  The flags \b, \i, \u and \v are toggles, turning on and off their respective
  265.  attribute. They may be combined. The \p flag turns off all attributes.
  266.  
  267.  The backslash character also escapes the character which follows it, that
  268.  is,
  269.  
  270.  \b
  271.  
  272.  indicates the toggling of the bold attribute, while
  273.  
  274.  \\b
  275.  
  276.  places a " \b" into the actual text.
  277.  
  278.  Lines are truncated to the specified width in characters (which defaults to
  279.  76); flags affecting the attribute do not count towards the 76-character
  280.  limit. When "/T" is specified, lines beginning with the specified
  281.  application's control character or "." are truncated at 255, regardless of
  282.  the width specification.
  283.  
  284.  
  285.  1.1.2  Cross-References
  286.  
  287.  Cross-references are embedded in one of two ways:
  288.  
  289.  
  290.    1.  Invisible text, immediately following a space-delineated word,
  291.        generates a cross-reference whose text is the invisible text and whose
  292.        hotspot is the entire word.
  293.  
  294.    2.  An anchor, signified by " \a", followed by normal text, which is then
  295.        followed by invisible text, generates a cross-reference whose text is
  296.        the invisible text and whose hotspot is all text between the anchor
  297.        and the beginning of the invisible text.
  298.  
  299.  
  300.  
  301.  1.1.3  QuickHelp Example
  302.  
  303.  The following is an example of a help database containing a single entry
  304.  using QuickHelp format:
  305.  
  306.    .context  #define
  307.    Syntax:   #define <identifier> <substitution-text>
  308.              #define <identifier> [(<parameter-list>)]
  309.              <substitution-text>
  310.  
  311.    Replaces all subsequent cases of \bidentifier\p with the
  312.  substitution-text.
  313.    If \bparameter-list\p is given after \bidentifier\p, each occurrence
  314.    of \bidentifier\p (\bparameter-list\p) is replaced with a version
  315.    of \isubstitution-text\p modified by substituting actual
  316.    arguments for formal parameters.
  317.  
  318.  
  319.  1.2  Minimally Formatted ASCII
  320.  
  321.  Uncompressed, minimally formatted ASCII help files can be used at run time
  322.  at the cost of slower searches and larger help files. Unformatted ASCII
  323.  files are a fixed width and may not contain highlighting or
  324.  cross-references.
  325.  
  326.  The help file is a sequential series of topics, each preceded by one or more
  327.  unique context definitions. Each context definition should be on a line of
  328.  its own, beginning with ">>." Subsequent lines up to the next context
  329.  definition constitute the topic text. For example:
  330.  
  331.    >>#define
  332.  
  333.    Syntax:   #define <identifier> <substitution-text>
  334.              #define <identifier> [(<parameter-list>)]
  335.              <substitution-text>
  336.  
  337.    Replaces all subsequent cases of identifier with the substitution-text.
  338.    If parameter-list is given after identifier, each occurrence of identifier
  339.  
  340.    (parameter-list) is replaced with
  341.    a version of substitution-text modified by substituting actual arguments
  342.    for formal parameters.
  343.  
  344.  The minimally formatted ASCII help file must begin with ">>." Since the
  345.  first topic in such a database must start with a context definition line
  346.  anyway, this allows for limited error checking to ensure that the referenced
  347.  file is indeed an ASCII help file.
  348.  
  349.  Minimally formatted ASCII files do not support non-default attributes or
  350.  cross-references.
  351.  
  352.  
  353.  1.3  Unformatted ASCII
  354.  
  355.  Fully unformatted ASCII files may be cross-referenced by other help files.
  356.  When referenced, the entire ASCII file is treated as a single help topic. No
  357.  formatting information may be present in such a file, and color may not be
  358.  used. The file is returned by the help engine "as is." Such a file has no
  359.  physical "next" or "previous."
  360.  
  361.  
  362.  1.4  RTF ASCII
  363.  
  364.  In this format, the database is formatted in a subset of RTF to support
  365.  special attributes. RTF syntax outside of the understood subset is ignored
  366.  and stripped out by HELPMAKE. RTF generated by other programs such as
  367.  Microsoft Word 4. x, Microsoft Word for the Apple(R) Macintosh(R), or
  368.  Word-RTF can be used directly. This allows help authors to write and format
  369.  directly in these word processors.
  370.  
  371.  HELPMAKE recognizes the subset of RTF listed below:
  372.  
  373.  RTF Code                          Action
  374.  ────────────────────────────────────────────────────────────────────────────
  375.  \plain                            Reset to default attributes. On most
  376.                                    screens this is unblinking normal
  377.                                    intensity.
  378.  
  379.  \b                                Bold. This is displayed as intensified
  380.                                    text.
  381.  
  382.  \i                                Italic. Displayed as reverse video.
  383.  
  384.  \v                                Hidden text. Hidden text is used for
  385.                                    cross-reference information and some
  386.                                    application-specific communications, and
  387.                                    is not displayed.
  388.  
  389.  \ul                               Underline. Represented as blue text on
  390.                                    adapters which do not support
  391.                                    underlining.
  392.  
  393.  \par                              End of paragraph.
  394.  
  395.  \pard                             Reset paragraph formatting to defaults.
  396.  
  397.  \fi                               Paragraph first line indent.
  398.  
  399.  \li                               Paragraph left indent.
  400.  
  401.  \line                             New line (not new paragraph).
  402.  
  403.  \tab                              Tab character.
  404.  
  405.  Topics may be paragraph-broken. HELPMAKE formats the text to a fixed width
  406.  at compression time.
  407.  
  408.  Each entry in the database source consists of one or more context strings,
  409.  followed by topic text. The sequence ">>" at the beginning of any paragraph
  410.  denotes the beginning of a new help entry. Subsequent text within that
  411.  paragraph constitutes the keyword. If the immediately following paragraph
  412.  begins with ">>," it also defines a context string for the same topic text.
  413.  Subsequent paragraphs, up to the next paragraph beginning with ">>",
  414.  constitute the topic text associated with those contexts.
  415.  
  416.  
  417.  1.4.1  RTF Example
  418.  
  419.  The following is an example of a help database containing a single entry
  420.  using minimal RTF text:
  421.  
  422.    {\rtf0
  423.    >> #define \par
  424.    Syntax:\tab #define <identifier> <substitution-text>
  425.    \par
  426.    \tab #define <identifier>[(<parameter-list>)] <substitution-text>
  427.    \par
  428.    \par
  429.    Replaces all subsequent cases of {\b identifier} with the
  430.  substitution-text.
  431.    If {\b parameter-list} is given after {\b identifier}, each occurrence
  432.    of
  433.    {\b identifier} ({\b parameter-list} ) is replaced with a version
  434.    of
  435.    {\i substitution-text} modified by substituting actual arguments for
  436.    formal parameters. \par
  437.    }
  438.  
  439.  The result, referenced by the context string #define:
  440.  
  441.    Syntax: #define <identifier> <substitution-text>
  442.            #define <identifier>[(<parameter-list>)] <substitution-text>
  443.  
  444.    Replaces all subsequent cases of identifier with the substitution-text.
  445.    If parameter-list is given after identifier, each occurrence
  446.    of identifier (parameter-list) is replaced with a version
  447.    of substitution-text modified by substituting actual
  448.    arguments for formal parameters.
  449.  
  450.  Note that the bold attributes in this example are shown as underline.
  451.  
  452.  
  453.  1.4.2  Local Contexts
  454.  
  455.  In RTF, QuickHelp, and minimal ASCII formats, certain context strings may be
  456.  defined as local contexts, being "local" to the help file. Then these
  457.  context strings may not be looked up by HelpNc, but instead may be used only
  458.  as the target of embedded cross references in the text.
  459.  
  460.  Local contexts are encoded just like normal contexts, except that they begin
  461.  with the at-sign character (@). The actual strings following the at sign are
  462.  discarded by HELPMAKE during compression. Cross-references to local contexts
  463.  are then encoded in the help file in a more compact form.
  464.  
  465.  Local contexts provide the following advantages:
  466.  
  467.  
  468.    ■   Space savings. The context strings are not preserved and hence are not
  469.        carried in the help file's context string table. Cross-references to
  470.        local contexts do not reference the actual context string, but instead
  471.        are encoded in a smaller, 3-byte format.
  472.  
  473.    ■   Access restriction. You cannot mistakenly ask for help on what would
  474.        be a local context string.
  475.  
  476.  
  477.  The following restrictions also apply:
  478.  
  479.  
  480.    ■   Local contexts must be resolvable within a single help file. HELPMAKE
  481.        produces warnings if a local context is cross-referenced, but never
  482.        defined in the help file being created.
  483.  
  484.    ■   Topics which are the targets of local contexts can be accessed in only
  485.        two ways: as the target of a cross-reference or by physical or
  486.        historical relative movement in the help file (Next, Previous, or
  487.        Back).
  488.  
  489.        For example:
  490.  
  491.        .context normal
  492.        This is a normal topic, accessible by the context string "normal."
  493.        [button\v@local\v] is a cross-reference to the following topic.
  494.  
  495.        .context @local
  496.        This topic can be reached only by physical previous or next, a
  497.  historical
  498.        backup, or by the cross-reference in the previous topic.
  499.  
  500.  
  501.  
  502.  1.5  Physical Database Organization
  503.  
  504.  The physical database consists of several pieces, as outlined below:
  505.  
  506.    +-----
  507.    | Header
  508.    +-----
  509.    | Topic Index
  510.    +-----
  511.    | Context Strings
  512.    +-----
  513.    | Context Map
  514.    +-----
  515.    | Keyphrase Table
  516.    +-----
  517.    | Huffman Decode Tree
  518.    +----
  519.    | Compressed Topic Text
  520.    +----
  521.    | File Title
  522.    +----
  523.  
  524.  Help files may also be concatenated together so that the above pattern is
  525.  repeated. For example,
  526.  
  527.    COPY FOO.HLP/B + BAR.HLP/B + YOU.HLP/B MONDO.HLP/B
  528.  
  529.  This command creates a single help file called MONDO.HLP, which consists of
  530.  the three component help files: FOO, BAR, and YOU. This file, when opened by
  531.  the help engine, counts as three files against the engine's open file limit.
  532.  In most other respects, it acts exactly like a single help file.
  533.  
  534.  
  535.  1.5.1  Concatenated Order
  536.  
  537.  The next several sections explain the pieces in the order in which they
  538.  physically appear in a concatenated help database.
  539.  
  540.  Header - Identifies the help file and contains data relating to the content
  541.  of the file. It is described by the following C structure:
  542.  
  543.    typedef struct {
  544.         ushort      wMagic;
  545.         ushort      wSignature;
  546.         ushort      wFlags;
  547.         ushort      appChar;
  548.         ushort      cTopics;
  549.         ushort      cContexts;
  550.         ushort      cbWidth;
  551.         ushort      cPreDef;
  552.         uchar       fname[14];
  553.         ushort      reserved[2];
  554.         ulong       posTbl[9];
  555.         ulong       fsize;
  556.         } header;
  557.  
  558.  where the following information is called out by the left-hand column:
  559.  
  560.  Header Data                       Description
  561.  ────────────────────────────────────────────────────────────────────────────
  562.  wMagic                            A word that identifies this as a help
  563.                                    file.
  564.  
  565.  wSignature                        A word that identifies the "owner" or
  566.                                    application that uses this help file.
  567.  
  568.  wFlags                            A word that contains the following
  569.                                    flags:
  570.  
  571.                                    Bit         Action
  572.  ────────────────────────────────────────────────────────────────────────────
  573.                                    0           Set if context look-up is to
  574.                                                be case sensitive.
  575.  
  576.                                    1           Set if the file is locked
  577.                                                and cannot be
  578.                                                decompressed.
  579.  
  580.  appChar                           Application-specific character,
  581.                                    controlling access to certain line of
  582.                                    help text. (See the /A parameter to
  583.                                    HELPMAKE.) 0xff if not set.
  584.  
  585.  cTopics                           A count of entries in the topic index.
  586.  
  587.  cContexts                         A count of context strings.
  588.  
  589.  cbWidth                           The fixed width encoded by HELPMAKE, if
  590.                                    one was specified. If zero, the data
  591.                                    must be formatted to the display width
  592.                                    by the application.
  593.  
  594.  cPreDef                           Count of predefined contexts.
  595.  
  596.  fname                             The original file name created by
  597.                                    HELPMAKE. This is used to identify
  598.                                    individual help files which have been
  599.                                    concatenated into larger help files.
  600.  
  601.  posTbl                            A table of file positions for the
  602.                                    various fields in the database:
  603.  
  604.                                    File        Description
  605.                                    Position
  606.  ────────────────────────────────────────────────────────────────────────────
  607.                                    0           File offset of the topic
  608.                                                index.
  609.  
  610.                                    1           File offset of the context
  611.                                                strings.
  612.  
  613.                                    2           File offset of the context
  614.                                                map.
  615.  
  616.                                    3           File offset of the keyphrase
  617.                                                table;
  618.                                                0 if keyphrase compression
  619.                                                was
  620.                                                not performed.
  621.  
  622.                                    4           File offset of the Huffman
  623.                                                decode
  624.                                                tree; 0 if Huffman encoding
  625.                                                was
  626.                                                not performed.
  627.  
  628.                                    5           File offset of text of the
  629.                                                first topic.
  630.  
  631.                                    6           File offset of file title.
  632.  
  633.                                    7-8         Reserved.
  634.  
  635.                                    9           Size of help file in bytes.
  636.  
  637.  Topic Index - A table of file positions for each topic contained in the
  638.  help file. Topic #n's file position can be found in the nth
  639.  entry in this table. In addition,
  640.  the size in bytes of any compressed topic can be determined by the
  641.  difference between two successive file positions.
  642.  
  643.  Context Strings - An array of strings which map to context numbers in the
  644.  following
  645.  context map. These strings are used for topic look-up when no predefined
  646.  context number has been assigned.
  647.  
  648.  Context Map - A mapping of context numbers to topic numbers. This allows
  649.  context numbers to be somewhat arbitrarily assigned, by an outside
  650.  piece of software, such as a parser, and then mapped to sequential
  651.  topic numbers.
  652.  
  653.  Keyphrase Table - Table of strings used in keyphrase decompression.
  654.  
  655.  Huffman Decode Tree - The tree used to decompress Huffman encoded data.
  656.  
  657.  Compressed Topic Text - The compressed text for the actual topic data,
  658.  preceded by
  659.  a 1-word count of bytes in the uncompressed topic.
  660.  
  661.  File Title - The title or name specified with the /N command at compression
  662.  time.
  663.  
  664.  
  665.  1.5.2  Decompressed Topic Format
  666.  
  667.  Each line of the decompressed topic is formatted as follows:
  668.  
  669.    +--------+----------------------+
  670.    | cbText | ASCII Text.......... |
  671.    +-------------------------+-----+--+----------------+
  672.    | cbInfo | Attr Info      | 0ffffh | Cross-Ref Info |
  673.    +-------------------------+--------+----------------+
  674.    .
  675.    .
  676.  
  677.  Topic information appears in the following order:
  678.  
  679.  Topic Data                        Description
  680.  ────────────────────────────────────────────────────────────────────────────
  681.  cbText                            Byte. Length in bytes, plus one, of the
  682.                                    ASCII text which follows.
  683.  
  684.  ASCII Text                        Text of the line. All characters are
  685.                                    displayable.
  686.                                    CR-LF characters have no special meaning.
  687.  
  688.  cbInfo                            Word. Length in bytes plus two of the
  689.                                    attribute and cross-reference
  690.                                    information that follows.
  691.  
  692.  Attr Info                         Information describing the attributes
  693.                                    associated with the preceding line.
  694.                                    These are formatted as attribute
  695.                                    index/byte-count-byte pairs with
  696.                                    attribute 0ffh indicating the end.
  697.  
  698.                                    Attribute indexes are bytes whose bits
  699.                                    represent the following attributes:
  700.  
  701.                                    Bit         Attribute
  702.  ────────────────────────────────────────────────────────────────────────────
  703.                                    0           Bold
  704.  
  705.                                    1           Italic
  706.  
  707.                                    2           Underline
  708.  
  709.                                    Thus, attribute indexes can range in
  710.                                    value from 0 -7, representing various
  711.                                    combinations of the above.
  712.  
  713.  Cross-Ref Info                    Definition of the "hotspots" contained
  714.                                    in the line and what they
  715.                                    cross-reference to. Each hotspot is
  716.                                    formatted as:
  717.  
  718.                                    +------+------+-----------+
  719.                                    |cols|cole|cross-ref|
  720.                                    +------+------+-----------+
  721.  
  722.                                    where format information breaks down as
  723.                                    follows:
  724.  
  725.                                    Definition  Description
  726.  ────────────────────────────────────────────────────────────────────────────
  727.                                    cols        Byte. Starting column of
  728.                                                hotspot.
  729.  
  730.                                    cole        Byte. Ending column of the
  731.                                                hotspot (inclusive).
  732.  
  733.                                    cross-ref   ASCIIZ string. Context which
  734.                                                the
  735.                                                hotspot cross-references to.
  736.                                                Either
  737.                                                a null-terminated ASCII
  738.                                                string or a
  739.                                                "local context" (a 3-byte
  740.                                                internal
  741.                                                data structure, the first
  742.                                                byte of
  743.                                                which is zero).
  744.  
  745.  
  746.  1.6  The Encoding Process
  747.  
  748.  The HELPMAKE utility makes several passes on the data when encoding source
  749.  files into help-file format. The amount of compression to be performed is
  750.  optional and is specified when HELPMAKE is run.
  751.  
  752.  HELPMAKE passes are described below.
  753.  
  754.  
  755.    1.  In the first pass, extraneous encoding information is stripped from
  756.        the file and remaining formatting information is converted to an
  757.        internal form. Local context references and definitions are collected.
  758.  
  759.    2.  During the second pass, local context references are resolved. If
  760.        enabled, the text is also run-length encoded. All runs of 4 to 255
  761.        identical characters are replaced with a flag, the character, and a
  762.        repetition count. During this pass the context strings are collected.
  763.        If keyphrase compression is enabled, the encoded text is analyzed for
  764.        keyword/phrase frequency.
  765.  
  766.    3.  If keyphrase compression is enabled, the following pass replaces all
  767.        space-saving occurrences of keyphrases with a flag byte and a byte
  768.        index. If Huffman encoding is enabled, character frequency of the
  769.        output is analyzed for Huffman tree construction.
  770.  
  771.    4.  If Huffman encoding is enabled, a following Huffman pass encodes the
  772.        topic text.
  773.  
  774.    5.  The next-to-last pass builds file topic and compression tables in
  775.        their final form in preparation for writing to the output file.
  776.  
  777.    6.  In the final pass, the actual help file is written. The help-file
  778.        header, topic index, context string table, context map, keyphrase
  779.        table, and Huffman tree are all written to the help file, followed by
  780.        the compressed topic text.
  781.  
  782.  
  783.  As noted above, once compressed, multiple help files can be manually
  784.  concatenated to produce single help files.
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  Chapter 2  Text Structure and Conventions
  792.  ────────────────────────────────────────────────────────────────────────────
  793.  
  794.  Common structures and conventions ensure that help files for one application
  795.  will make sense when viewed using another. This information goes beyond the
  796.  context-string and topic-text mapping functions of the help engine itself.
  797.  This chapter outlines organizational conventions and approaches that should
  798.  be followed by applications that provide maximally cross-compatible help
  799.  files.
  800.  
  801.  
  802.  2.1  Authoring the Help Database
  803.  
  804.  The help engine is a data-retrieval tool that imposes no real restrictions
  805.  on the content and format of the help text. The HELPMAKE utility and
  806.  additional display routines and conventions, however, make certain
  807.  assumptions about the format of help text. This section provides some help
  808.  authoring guidelines.
  809.  
  810.  
  811.  2.1.1  QuickHelp Format
  812.  
  813.  When using QuickHelp format, a text editor would be used. QuickHelp format
  814.  also lends itself to relatively easy automated translation from other
  815.  document forms.
  816.  
  817.  Help text source is a sequential series of topics, each preceded by one or
  818.  more unique context definitions. In QuickHelp format, each topic begins with
  819.  one or
  820.  
  821.  more ".context" lines defining the context strings which map to the topic
  822.  text. Subsequent lines up to the next ".context" constitute the topic text.
  823.  For example:
  824.  
  825.    .context #define
  826.    Syntax: #define <identifier> <substitution-text>
  827.     #define <identifier> [(<parameter-list>)]
  828.     <substitution-text>
  829.  
  830.    Replaces all subsequent cases of \bidentifier\p with the
  831.  substitution-text.
  832.    If \bparameter-list\p is given after \bidentifier\p, each occurrence
  833.    of \bidentifier\p (\bparameter-list\p) is replaced with a version
  834.    of \isubstitution-text\p modified by substituting actual arguments
  835.    for formal parameters.
  836.  
  837.  See Chapter 1 for a detailed discussion of QuickHelp.
  838.  
  839.  
  840.  2.1.2  RTF Format
  841.  
  842.  When using RTF format, authoring can take place using a word processor  or
  843.  other tool capable of generating RTF output. Mac WORD, Microsoft  Word 4.x,
  844.  and Word-RTF (a tool that converts Word format files to RTF) are all
  845.  alternatives.
  846.  
  847.  In RTF, each context definition should be in a paragraph of its own,
  848.  beginning with ">>." Subsequent paragraphs up to the next context definition
  849.  constitute the topic text. For example:
  850.  
  851.    {\rtf0
  852.    >> #define \par
  853.    Syntax:\tab #define <identifier> <substitution-text>
  854.    \par
  855.    \tab #define <identifier>[(<parameter-list>)] <substitution-text>
  856.    \par
  857.    \par
  858.    Replaces all subsequent cases of {\b identifier} with the
  859.  substitution-text.
  860.    If {\b parameter-list} is given after {\b identifier}, each occurrence
  861.    of
  862.    {\b identifier} ({\b parameter-list} ) is replaced with a version
  863.    of
  864.    {\i substitution-text} modified by substituting actual arguments for
  865.    formal parameters. \par
  866.    }
  867.  
  868.  In these examples, the context string  #define  relates to the topic text
  869.  which follows it. The topic text contains embedded bold and italic text. See
  870.  Chapter 1 for a detailed discussion of RTF format.
  871.  
  872.  
  873.  2.2  Hotspots and Cross-References
  874.  
  875.  Cross-references are included as invisible text. A word or an anchored
  876.  phrase, known as a hotspot, followed by invisible text, constitutes a
  877.  cross-reference. For example:
  878.  
  879.    .context EXE2BIN
  880.    EXE2BIN
  881.  
  882.    Convert .EXE file to Binary-Image File
  883.  
  884.    \bPurpose\b
  885.  
  886.    Converts an executable file in the .EXE\vexe_format\v format to a
  887.    memory image file in binary format. The EXE2BIN utility is supplied
  888.    with the MS-DOS distribution disks.
  889.  
  890.  In this example, the word ".EXE" in the first line of the paragraph is the
  891.  hotspot. It cross-references to "exe_format." A mouse click or other form of
  892.  selection with the cursor on any of the letters of ".EXE" brings up the help
  893.  topic whose context was "exe_format." The invisible text "exe_format" is not
  894.  actually displayed.
  895.  
  896.  When the desired hotspot crosses more than one word, an anchor is used:
  897.  
  898.    Converts an executable file in the \a.EXE format\vexe_format\v
  899.    to a memory image file in binary format. The EXE2BIN utility is
  900.    supplied with the MS-DOS distribution disks.
  901.  
  902.  In this case, the hotspot consists of the entire phrase ".EXE format."
  903.  Anchored hotspots must be contained on a single line.
  904.  
  905.  The invisible cross-reference text is formatted as one of the following:
  906.  
  907.  Text Command                      Action
  908.  ────────────────────────────────────────────────────────────────────────────
  909.  context_string                    Results in the help topic associated
  910.                                    with the arbitrary context string being
  911.                                    displayed. For example, "exe_format"
  912.                                    results in the help topic associated
  913.                                    with that context being displayed.
  914.  
  915.  @context_string                   Causes the help topic associated with
  916.                                    the local context string to be displayed.
  917.                                    As defined in a previous section, local
  918.                                    contexts must be defined in the same
  919.                                    help file that they are referenced in.
  920.  
  921.  filename!                         Causes the entire file referenced to
  922.                                    be treated as a single topic to be
  923.                                    displayed. For example, the command
  924.                                    "$INCLUDE:stdio.h!" would search the
  925.                                    INCLUDE environment variable for STDIO.H,
  926.                                    and display it as a single help topic.
  927.  
  928.  filename!context_string           Same as "context_string" above, except
  929.                                    that only the help file "filename" is
  930.                                    searched. If not already open, it is
  931.                                    searched for, either on the path or
  932.                                    explicit environment variable, and
  933.                                    opened. For example, the command
  934.                                    "$INIT:mep.hlp!assign" would search for
  935.                                    "mep.hlp" on the INIT environment
  936.                                    variable, and bring up the topic
  937.                                    associated with "assign."
  938.  
  939.  !cmd                              A cross-reference command. These
  940.                                    commands are discussed in Section 2.4.
  941.  
  942.  
  943.  2.3  Topic Commands
  944.  
  945.  Topic commands embedded into the help text provide additional control
  946.  information to the application displaying help. The commands are contained
  947.  on a single line which is not considered part of the help text, and is not
  948.  displayed to the user, but is embedded into the help text source.
  949.  
  950.  With the exception of ".context" and ".comment," topic commands take two
  951.  forms: an "English" version used in the help source code (dot command), and
  952.  a shortened version actually placed in the encoded help file and understood
  953.  by the application displaying help (colon command). English versions of the
  954.  commands are automatically converted by the HELPMAKE program to the single
  955.  character versions (or back) on encode (or decode).
  956.  
  957.  Note that ":" is replaced by whatever application-specific character is
  958.  specified to HELPMAKE using the /A parameter. Applications writers should
  959.  support only the ":" commands listed below. Help-file authors should be
  960.  concerned with only the English "." forms of the commands discussed in Table
  961.  2.1.
  962.  
  963.  Table 2.1  HELPMAKE Topic Commands
  964.  
  965. ╓┌─────────────────────────────────────┌─────────────────────────────────────╖
  966.  Command                               Action
  967.  ────────────────────────────────────────────────────────────────────────────
  968.  Command                               Action
  969.  ────────────────────────────────────────────────────────────────────────────
  970.  .context context string               Required.
  971.  
  972.  .category string number               Contains the category name the
  973.  :cstring number                       current function is in, and its
  974.                                        position in the list of functions.
  975.                                        The .category name is used by the
  976.                                        QuickHelp Topic command, which
  977.                                        brings up the list of topics that
  978.                                        the current topic is part of. This
  979.                                        is done by fetching the category
  980.                                        name, which is a .list-type topic,
  981.                                        and finding where the current topic
  982.                                        is within the list of topics.
  983.  
  984.                                        If the help topic being displayed at
  985.                                        the time of a request is for
  986.                                        "h.contents" (the table of contents),
  987.                                        applications may divert the search
  988.                                        to the .category string of the
  989.  Command                               Action
  990.  ────────────────────────────────────────────────────────────────────────────
  991.                                       to the .category string of the
  992.                                        currently displayed topic.
  993.  
  994.                                        The .category command, if present,
  995.                                        must precede all displayable help
  996.                                        text. If not supported by an
  997.                                        application, this command should be
  998.                                        ignored.
  999.  
  1000.  .command                              Indicates that the topic text is not
  1001.  :x                                    a displayable help topic, and should
  1002.                                        not be displayed to the user. Used
  1003.                                        to precede script topics, and other
  1004.                                        internal information.
  1005.  
  1006.                                        The .command command, if present,
  1007.                                        must precede all displayable help
  1008.                                        text. Should be supported by all
  1009.                                        applications. (If a next or previous
  1010.  Command                               Action
  1011.  ────────────────────────────────────────────────────────────────────────────
  1012.                                       applications. (If a next or previous
  1013.                                        operation encounters a topic
  1014.                                        containing this command, the topic
  1015.                                        should simply be skipped.)
  1016.  
  1017.  .comment text                         Used in the source file to specify a
  1018.                                        comment line which will not be
  1019.                                        placed into the database (i.e.,
  1020.                                        HELPMAKE removes this line). This is
  1021.                                        used by help authors to comment
  1022.                                        their source code so that it can be
  1023.                                        maintained by other authors without
  1024.                                        having the text go into the database.
  1025.                                        This can be particularly valuable
  1026.                                        when documenting cross-
  1027.                                        references that have commands (i.e.,
  1028.                                        you can insert a .comment and say
  1029.                                        what the cross-reference is supposed
  1030.                                        to do).
  1031.  Command                               Action
  1032.  ────────────────────────────────────────────────────────────────────────────
  1033.                                       to do).
  1034.  
  1035.                                        Since the comments are not preserved
  1036.                                        in the compressed file, they cannot
  1037.                                        be restored via decompression.
  1038.  
  1039.  .execute cmd                          Executes the specified
  1040.  :ycmd                                 cross-reference command. This
  1041.                                        command is executed at the time the
  1042.                                        line is encountered while the
  1043.                                        application is processing the topic
  1044.                                        for display. All cross-reference
  1045.                                        commands are valid, even though not
  1046.                                        all make sense. This command may
  1047.                                        appear anywhere in a topic.
  1048.  
  1049.                                        If not supported by an application,
  1050.                                        this command should be ignored.
  1051.  
  1052.  Command                               Action
  1053.  ────────────────────────────────────────────────────────────────────────────
  1054. 
  1055.  .file filename                        Normally used by an internal release
  1056.  :ffilename                            of the database to point to the
  1057.                                        location of the source file. The
  1058.                                        private build of QuickHelp along
  1059.                                        with a macro command in MEP
  1060.                                        can make it possible to load the
  1061.                                        source file with two keystrokes.
  1062.  
  1063.                                        If not supported by an application,
  1064.                                        should be ignored.
  1065.  
  1066.  .freeze ##                            Indicates that the next ## lines
  1067.  :z ##                                 which follow are to be "frozen" as
  1068.                                        the top line(s) on the help screen.
  1069.                                        This is typically used to freeze a
  1070.                                        row of cross-reference buttons at
  1071.                                        the top of a help topic which might
  1072.                                        be scrolled.
  1073.  Command                               Action
  1074.  ────────────────────────────────────────────────────────────────────────────
  1075.                                       be scrolled.
  1076.  
  1077.                                        The .freeze command, if present,
  1078.                                        must precede all displayable help
  1079.                                        text. If not supported, should be
  1080.                                        ignored.
  1081.  
  1082.  .mark text [##]                       Defines a "mark" immediately
  1083.  :mtext [##]                           preceding the following line of text.
  1084.                                        An optional number, indicating
  1085.                                        column location, may also be
  1086.                                        included. Can be referenced by
  1087.                                        Advisor Script commands (see Section
  1088.                                        2.4), usually to indicate that
  1089.                                        display of a particular topic begins
  1090.                                        at the marked line, rather than the
  1091.                                        first line.
  1092.  
  1093.                                        .mark names are unique (local) to
  1094.  Command                               Action
  1095.  ────────────────────────────────────────────────────────────────────────────
  1096.                                       .mark names are unique (local) to
  1097.                                        each topic. If not supported by an
  1098.                                        application, should be ignored.
  1099.  
  1100.  .length #                             Specifies the initial length of the
  1101.  :l#                                   topic when displayed. Applications
  1102.                                        that can resize the window in which
  1103.                                        help is displayed should attempt to
  1104.                                        resize so that # number of lines are
  1105.                                        displayed.
  1106.  
  1107.                                        The .length command, if present,
  1108.                                        must precede all displayable help
  1109.                                        text. If not supported by an
  1110.                                        application, should be ignored, and
  1111.                                        the application must support a
  1112.                                        reasonable default window or screen
  1113.                                        size.
  1114.  
  1115.  Command                               Action
  1116.  ────────────────────────────────────────────────────────────────────────────
  1117. 
  1118.  .list                                 Indicates that the current topic
  1119.  :i                                    contains a list of topics. This will
  1120.                                        cause a highlighted line to be
  1121.                                        displayed. You can select a topic by
  1122.                                        moving the highlighted line over the
  1123.                                        desired topic, and then pressing the
  1124.                                        ENTER key. The first word of the
  1125.                                        line will be used as the topic
  1126.                                        string to search for.
  1127.  
  1128.                                        If not supported by an application,
  1129.                                        the topic should
  1130.                                        be displayed as any other help topic
  1131.                                        (i.e., .list can be ignored).
  1132.  
  1133.  .next context string                  Indicates that the physically next
  1134.  :>context string                      topic should be looked up using the
  1135.                                        supplied context string, rather than
  1136.  Command                               Action
  1137.  ────────────────────────────────────────────────────────────────────────────
  1138.                                       supplied context string, rather than
  1139.                                        getting the actual next topic. This
  1140.                                        is used to skip large blocks of
  1141.                                        .command or .popup topics quickly.
  1142.  
  1143.                                        The .next command, if present, must
  1144.                                        precede all displayable help text.
  1145.  
  1146.  .previous context string              Tells the help system to look up the
  1147.  :<context string                      physically previous topic using the
  1148.                                        supplied context string rather than
  1149.                                        get the actual previous topic. This
  1150.                                        is used to skip large blocks of
  1151.                                        .command or .popup topics quickly.
  1152.  
  1153.  .paste paste-name                     Begins a paste section, with the
  1154.  :ppaste-name                          name appearing in QuickHelp's Paste
  1155.                                        menu. If not supported by an
  1156.                                        application, should be ignored.
  1157.  Command                               Action
  1158.  ────────────────────────────────────────────────────────────────────────────
  1159.                                       application, should be ignored.
  1160.  
  1161.                                        The .paste command, if present, must
  1162.                                        precede all displayable help text.
  1163.  
  1164.  .end                                  Ends a paste section. If not
  1165.  :e                                    supported by an application, this
  1166.                                        command should be ignored.
  1167.  
  1168.  .popup                                Indicates to QuickHelp that the
  1169.  :g                                    current topic is not to be loaded as
  1170.                                        a normal, scrollable topic. Instead
  1171.                                        the number of lines in the current
  1172.                                        topic is counted, and a box is
  1173.                                        created with the topic displayed
  1174.                                        within it. As soon as you press a
  1175.                                        key or click the mouse button, the
  1176.                                        popup box will go away. If you have
  1177.                                        already loaded QuickHelp, the
  1178.  Command                               Action
  1179.  ────────────────────────────────────────────────────────────────────────────
  1180.                                       already loaded QuickHelp, the
  1181.                                        previous topic is displayed.
  1182.  
  1183.                                        When QuickHelp is first run, it
  1184.                                        attempts to find a topic from the
  1185.                                        word underneath the cursor. If that
  1186.                                        topic is a popup topic, QuickHelp
  1187.                                        displays the popup box, then returns
  1188.                                        without displaying its main window.
  1189.  
  1190.                                        The .popup command, if present, must
  1191.                                        precede all displayable help text.
  1192.                                        If not supported by an application,
  1193.                                        the topic can be displayed normally.
  1194.  
  1195.  .ref [string], [string], ...          Contains a list of comma-separated
  1196.  :r[string], [string], ...             topics (i.e., functions and
  1197.                                        structures) that appear in the
  1198.                                        Reference menu, and will be
  1199.  Command                               Action
  1200.  ────────────────────────────────────────────────────────────────────────────
  1201.                                       Reference menu, and will be
  1202.                                        preloaded by the PreLoad thread. If
  1203.                                        not supported by an application,
  1204.                                        this command should be ignored.
  1205.  
  1206.  .topic topic name                     If not supported by an application,
  1207.  :ntopic name                          this command should be ignored, and
  1208.                                        no title or name displayed.
  1209.  
  1210.  ────────────────────────────────────────────────────────────────────────────
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  2.4  Cross-Reference Commands
  1216.  
  1217.  Cross-reference commands extend hotspots beyond simply moving around in help
  1218.  information. These commands actually carry out actions in response to user
  1219.  selection.
  1220.  
  1221.  Typically, when a hotspot is selected by the user of the help system, the
  1222.  associated invisible text or "cross-reference" is simply "looked-up" as
  1223.  another help request, and its associated topic displayed. A cross-reference
  1224.  command (usually prefixed by an exclamation point) contains instead an
  1225.  instruction to be carried out by the host application.
  1226.  
  1227.  The executable command, or in some cases the command class, is defined by
  1228.  its first character. Uppercase alphabetic and special character commands are
  1229.  broadly classified as "Advisor Script Commands," and potentially applicable
  1230.  to all help systems. Lowercase characters are used to define commands or
  1231.  command classes of restricted applicability.
  1232.  
  1233.  These commands are discussed in Table 2.2.
  1234.  
  1235.  Table 2.2  HELPMAKE Cross-Reference Commands
  1236.  
  1237. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  1238.  Command                           Class
  1239.  ────────────────────────────────────────────────────────────────────────────
  1240.  >string                           Indirection. The rest of the command is
  1241.  Command                           Class
  1242.  ────────────────────────────────────────────────────────────────────────────
  1243.  >string                           Indirection. The rest of the command is
  1244.                                    a context string which should be looked
  1245.                                    up, and whose topic contents should be
  1246.                                    executed, line by line, as a series of
  1247.                                    Advisor Script Commands. Such a topic is
  1248.                                    referred to as a script topic. The
  1249.                                    initial exclamation point is not present
  1250.                                    on the commands contained within a
  1251.                                    script topic.
  1252.  
  1253.  space                             The rest of the command string should be
  1254.                                    executed visibly by the operating system.
  1255.                                    For example, "! DIR" causes the
  1256.                                    operating system to print the contents
  1257.                                    of the current directory.
  1258.  
  1259.  !                                 The rest of the command string should be
  1260.                                    executed invisibly by the operating
  1261.                                    system. For example, "!!COPY FILEA FILEB"
  1262.  Command                           Class
  1263.  ────────────────────────────────────────────────────────────────────────────
  1264.                                   system. For example, "!!COPY FILEA FILEB"
  1265.                                    causes the operating system to copy
  1266.                                    FILEA to FILEB, with no visible output.
  1267.  
  1268.  B                                 Back. The application is to redisplay
  1269.                                    the previously viewed help topic. May be
  1270.                                    ignored if the historical backtrace list
  1271.                                    is exhausted, or if historical backtrace
  1272.                                    is not supported by the application.
  1273.  
  1274.  C                                 Context. The rest of the command string
  1275.                                    is a context string to be retrieved and
  1276.                                    immediately displayed. (Intended for use
  1277.                                    within script topics.) This is
  1278.                                    equivalent to a traditional
  1279.                                    cross-reference that does not begin with
  1280.                                    a "!."
  1281.  
  1282.  D                                 Delay. The rest of the command string is
  1283.  Command                           Class
  1284.  ────────────────────────────────────────────────────────────────────────────
  1285. D                                 Delay. The rest of the command string is
  1286.                                    an ASCII encoded number, which is the
  1287.                                    number of tenths of a second to delay.
  1288.                                    When executed, the application simply
  1289.                                    delays that much time before continuing.
  1290.                                    (Intended for use within script topics.)
  1291.  
  1292.  Hsx1,y1, x2,y2                    Highlight. The rest of the command
  1293.                                    specifies a region, and a highlighting
  1294.                                    state "s" is replaced by either "E" to
  1295.                                    enable highlighting on the region, or "D"
  1296.                                    to disable. The highlighted region is
  1297.                                    from the upper left corner specified by
  1298.                                    (x1,y1) to the lower right corner
  1299.                                    specified by (x2,y2). All coordinates
  1300.                                    are one-based. The actual visual effect
  1301.                                    of highlighting is left up to the
  1302.                                    application; however, reverse video is
  1303.                                    the commonly accepted result.
  1304.  Command                           Class
  1305.  ────────────────────────────────────────────────────────────────────────────
  1306.                                   the commonly accepted result.
  1307.  
  1308.  K                                 Wait for any keystroke before proceeding.
  1309.  
  1310.  Kkey                              Wait for specific keystroke before
  1311.                                    proceeding; "key" is replaced by the key
  1312.                                    name. Beep until correct key is entered.
  1313.  
  1314.  Kkey text                         Wait for specific keystroke before
  1315.                                    proceeding; "key" is replaced by the key
  1316.                                    name. Display "text" if wrong key is
  1317.                                    entered.
  1318.  
  1319.  Mtext                             Mark. Position current topic such that
  1320.                                    the line marked by "text" is the first
  1321.                                    line displayed. (See topic commands for
  1322.                                    a description of marked text.)
  1323.  
  1324.  Ptext text                        Position. Combination of .context and
  1325.  Command                           Class
  1326.  ────────────────────────────────────────────────────────────────────────────
  1327. Ptext text                        Position. Combination of .context and
  1328.                                    .mark commands. The second "text" string
  1329.                                    is a context looked up and immediately
  1330.                                    displayed. The first "text" string is a
  1331.                                    mark at which the display of the topic
  1332.                                    should begin.
  1333.  
  1334.  b                                 Specific to Basic.
  1335.  
  1336.  c                                 Specific to C.
  1337.  
  1338.  CQ.HB                             Used in Microsoft QuickC(R) version 2.0.
  1339.                                    Indicates that the previously viewed
  1340.                                    help topic should be redisplayed.
  1341.                                    (Executes the QuickC version 2.0 "Help
  1342.                                    Back" command.) This is equivalent to
  1343.                                    the Advisor Script Command "back" listed
  1344.                                    above, and should also be supported by
  1345.                                    applications requiring compatibility
  1346.  Command                           Class
  1347.  ────────────────────────────────────────────────────────────────────────────
  1348.                                   applications requiring compatibility
  1349.                                    with C and QuickC help files.
  1350.  
  1351.  d                                 Specific to the Microsoft CodeView(R)
  1352.                                    debugger.
  1353.  
  1354.  m                                 The command is specific to the Microsoft
  1355.                                    Editor and/or Programmer's WorkBench
  1356.                                    (PWB). The command is an editor macro
  1357.                                    string, which is executed.
  1358.  
  1359.  q                                 Specific to the QuickHelp utility.
  1360.  
  1361.  ────────────────────────────────────────────────────────────────────────────
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  2.5  Context Conventions
  1367.  
  1368.  Certain contexts are defined by convention across multiple product lines.
  1369.  The intent is that multiple products can access the same types of help in
  1370.  the same manner, while also providing mechanisms for truly product-specific
  1371.  help to be readily identified as such.
  1372.  
  1373.  Constructed context strings are kept small, to avoid unnecessary growth of
  1374.  the context string table in each help file. In addition, many utilities
  1375.  using the help system will display the context strings associated with help
  1376.  topics. These conventions also define characteristics which allow such
  1377.  utilities to present more intelligent information.
  1378.  
  1379.  
  1380.  2.5.1  Contexts Covered by Convention
  1381.  
  1382.  Context strings beginning with "x." (where "x" is an arbitrary character,
  1383.  and "." is a period) are defined to be "internal" or "constructed" help
  1384.  context strings. They are unlikely to be explicitly requested, and you may
  1385.  in fact be prevented from entering contexts of this form.
  1386.  
  1387.  The following "lead" characters are defined:
  1388.  
  1389.  Character                         Definition
  1390.  ────────────────────────────────────────────────────────────────────────────
  1391.  h                                 Generic help. Prefixes miscellaneous
  1392.                                    help contexts that may be constructed or
  1393.                                    otherwise hidden from the user. For
  1394.                                    example, a "contents" menu item would
  1395.                                    cause a reference to "h.contents."
  1396.  
  1397.  m                                 Menu items. Contexts that relate to
  1398.                                    product menu items are further defined
  1399.                                    by their accelerator keys (for example,
  1400.                                    the Open selection on the File menu is
  1401.                                    referenced by "m.f.o").
  1402.  
  1403.  d                                 Dialogs. Dialogs are assigned a number,
  1404.                                    and the help context string is
  1405.                                    constructed by "d." and the ASCII text
  1406.                                    number (for example, "d.12").
  1407.  
  1408.  e                                 Error numbers. Products that support the
  1409.                                    uniform error numbering scheme used
  1410.                                    within languages would reference those
  1411.                                    by prefixing the error number with "e."
  1412.                                    (for example, "e.c1234").
  1413.  
  1414.  !                                 Indicates a cross-reference command, as
  1415.                                    defined in Table 2.2.
  1416.  
  1417.  
  1418.  2.5.2  Required Contexts
  1419.  
  1420.  The following contexts should be provided in all help files:
  1421.  
  1422.  Context                           Description
  1423.  ────────────────────────────────────────────────────────────────────────────
  1424.  h.default                         This is the "most-default" help screen,
  1425.                                    generally displayed in response to
  1426.                                    pressing F1 at the "top level" in most
  1427.                                    applications.
  1428.  
  1429.  h.notfound                        This is the help-text applications
  1430.                                    display when a search for a particular
  1431.                                    context fails. Can be an index, topical
  1432.                                    list, or general help. Applications may
  1433.                                    alternately present error messages when
  1434.                                    help cannot be found.
  1435.  
  1436.  h.pg1                             Indicates the help text that is
  1437.                                    logically the first "page" in the file.
  1438.                                    Used by some applications in response to
  1439.                                    a "go to the beginning" request in help
  1440.                                    manipulation.
  1441.  
  1442.  h.pg$                             Indicates the help text which is
  1443.                                    logically the last "page" in the file.
  1444.                                    This is used by some applications in
  1445.                                    response to a "go to the end" request in
  1446.                                    help manipulation.
  1447.  
  1448.  
  1449.  2.5.3  Recommended Contexts
  1450.  
  1451.  The following contexts are not mandatory, but if used, should be of the
  1452.  following defined forms:
  1453.  
  1454.  Context                           Description
  1455.  ────────────────────────────────────────────────────────────────────────────
  1456.  h.contents                        Help-file table of contents. In addition,
  1457.                                    the context string contents may also be
  1458.                                    used by itself to allow direct reference
  1459.                                    by the user.
  1460.  
  1461.  h.index                           Help-file index. In addition, the
  1462.                                    context string index may also be used by
  1463.                                    itself to allow direct reference by the
  1464.                                    user.
  1465.  
  1466.  h.pg#                             Specific page number. "#" is replaced
  1467.                                    with the page number of interest.
  1468.  
  1469.  Care should be taken to maintain "common" usage when writing help that is
  1470.  referenced from context strings such as these, since other applications may
  1471.  access them in this manner.
  1472.  
  1473.  
  1474.  2.5.4  Product-Specific Contexts
  1475.  
  1476.  When multiple products use the same naming mechanisms for the same
  1477.  operations, confusion can arise when one product help file is made available
  1478.  for use by another product. For example, search order might be the only
  1479.  factor determining which product's help appears when a request for help is
  1480.  made from a File:Open menu and multiple product help files are available.
  1481.  All products would reference the context string "m.f.o" by convention, and
  1482.  it would be in both help files.
  1483.  
  1484.  As defined elsewhere, contexts can be prefixed by a file name. The original
  1485.  help-file file names are also embedded in each help file, and preserved
  1486.  regardless of what you rename the help file. This allows product-specific
  1487.  contexts to be dereferenced by prefixing the original help-file name to the
  1488.  context string.
  1489.  
  1490.  For example, in PWB, QB.HLP, QC.HLP, and PWB.HLP are available. All have a
  1491.  "m.f.o" context entry. When you request help on the File:Open menu, however,
  1492.  PWB prefixes that string with "pwb.hlp!", creating "pwb.hlp!m.f.o" which
  1493.  completely specifies that the help comes from the PWB help file.
  1494.  
  1495.  
  1496.  2.6  Hierarchical Contexts
  1497.  
  1498.  Hierarchical context strings should be manufactured by concatenating context
  1499.  strings with period separators to form longer context strings. For example:
  1500.  
  1501.  
  1502.    cc.error.c1876
  1503.  
  1504.  could represent help relating to a C compiler error number c1876. The
  1505.  application could manufacture a help look-up request based on its current
  1506.  state, such as currently viewing errors on a C compiler, where c1876 is the
  1507.  currently viewed error.
  1508.  
  1509.  For space reasons, it may also be advisable to shorten contexts as much as
  1510.  possible, when the context string will never be seen by the user. This is
  1511.  the shortened example:
  1512.  
  1513.    c.e.1876
  1514.  
  1515.  It is important to note that the help engine does not infer anything from
  1516.  the fact that the context string may be viewed elsewhere as a concatenated
  1517.  hierarchy. Only a help topic whose entire context string matches exactly
  1518.  will correspond to such a request.
  1519.  
  1520.  
  1521.  2.7  Environment Support
  1522.  
  1523.  File names used within the help engine may include explicit path
  1524.  specifications or explicit environment variable specifications, or it may
  1525.  default to being opened on the PATH environment variable. The support for
  1526.  each of these is provided by the client application. For example:
  1527.  
  1528.  Path                              Description
  1529.  ────────────────────────────────────────────────────────────────────────────
  1530.  c:\lib\qb.hlp                     Explicit path
  1531.  
  1532.  $INCLUDE:qb.hlp                   Explicit environment variable
  1533.  
  1534.  qb.hlp                            Implicit PATH search
  1535.  
  1536.  Applications may also elect to support the HELPFILES environment variable
  1537.  that specifies the help files to be used. When used, the syntax of this
  1538.  variable should be
  1539.  
  1540.    SET HELPFILES=QB.HLP;QC.HLP;CV.HLP
  1541.  
  1542.  This example instructs applications to use the three help files, QB.HLP,
  1543.  QC.HLP, and CV.HLP, in that order. This may be overridden within the
  1544.  application.
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  Chapter 3  The HELPMAKE Program
  1552.  ────────────────────────────────────────────────────────────────────────────
  1553.  
  1554.  HELPMAKE is a general support program that manipulates help files. It can
  1555.  dump a help file to RTF text format for editing, and compress an RTF,
  1556.  QuickHelp, or modified ASCII formatted text file into help-file format.
  1557.  
  1558.  HELPMAKE is a distributed utility; further documentation is available in the
  1559.  C 6.0 Compiler or Microsoft QuickC 2.0 Compiler products. Use HELPMAKE when
  1560.  you want to modify Microsoft-supplied help or to compress user-supplied help
  1561.  files.
  1562.  
  1563.  
  1564.  3.1  HELPMAKE Options
  1565.  
  1566.  The syntax for HELPMAKE is as follows:
  1567.  
  1568.    HELPMAKE { /E[n] [/Ac] [/C] [/L] [/N name] [/Sn] [/Wwidth]
  1569.    | /D[U|S] | /H }
  1570.                [/T][ [/V[n» [/Odestfile] sourcefile(s)
  1571.  
  1572.  At least one source file and either the "/E" (for Encode) or "/D" (for
  1573.  Decode) must be present.
  1574.  
  1575.  
  1576.  3.1.1  Encoding Options
  1577.  
  1578.  When encoding (/E) to create a help file, the /O parameter must be present.
  1579.  Multiple source files may be specified, including wild cards.
  1580.  
  1581.  The optional n parameter on /E indicates the amount of compression to take
  1582.  place. Successive powers of two indicate various compression techniques to
  1583.  use, as in the following list:
  1584.  
  1585. ╓┌─────────────────────┌─────────────────────────────────────────────────────╖
  1586.  Parameter             Technique
  1587.  ────────────────────────────────────────────────────────────────────────────
  1588.  0                     No compression
  1589.  1                     Run-length compression
  1590.  2                     Keyword compression
  1591.  4                     Extended keyword compression
  1592.  8                     Huffman compression
  1593.  
  1594.  
  1595.  For example, to use both run-length and keyword compression, specify /E3.
  1596.  The default is all compression-selected.
  1597.  
  1598.  Mixing the types of compression allows HELPMAKE to be maximally fast while
  1599.  developing help files, or at the user's option when used in the field.
  1600.  
  1601.  
  1602.  3.1.2  Other HELPMAKE Options
  1603.  
  1604.  Other options that apply when encoding are listed below:
  1605.  
  1606. ╓┌───────┌─────────────────────────────────┌─────────────────────────────────╖
  1607.  Option  Action
  1608.  ────────────────────────────────────────────────────────────────────────────
  1609.  /A      Specifies the
  1610.          application-specific control
  1611.          character
  1612.          for the file. This is used with
  1613.          the HelpGetCells, HelpGetLine,
  1614.          and HelpGetLineAttr calls to
  1615.          ignore lines that begin with
  1616.          this character. This feature
  1617.          allows you to embed control
  1618.          information into the help topics.
  1619.  Option  Action
  1620.  ────────────────────────────────────────────────────────────────────────────
  1621.         information into the help topics.
  1622.          Such information can then be
  1623.          automatically stripped out by
  1624.          other applications without
  1625.          determining the format.
  1626.  
  1627.  /C      Indicates that the context
  1628.          strings for this help file are
  1629.          case sensitive. All look-ups at
  1630.          run time are case sensitive if
  1631.          this switch has been set.
  1632.  
  1633.  /W      When specified, indicates the
  1634.          fixed width of the resulting
  1635.          help text, in characters. The
  1636.          default value is 76. When
  1637.          HELPMAKE is run to encode RTF
  1638.          source, HELPMAKE automatically
  1639.          formats the text to this width.
  1640.  Option  Action
  1641.  ────────────────────────────────────────────────────────────────────────────
  1642.         formats the text to this width.
  1643.          When used with QuickHelp or
  1644.          Minimal ASCII, lines are
  1645.          truncated to this width.
  1646.  
  1647.  /L      Locks the generated file so that
  1648.          it cannot be decoded by HELPMAKE
  1649.          later.
  1650.  
  1651.  /Sn     Specifies the type of input
  1652.          file:
  1653.  
  1654.          Option                            File Type
  1655.  
  1656.          1                                 RTF ASCII
  1657.  
  1658.          2                                 QuickHelp ASCII (default)
  1659.  
  1660.          3                                 Minimally formatted (>) ASCII
  1661.  Option  Action
  1662.  ────────────────────────────────────────────────────────────────────────────
  1663.         3                                 Minimally formatted (>) ASCII
  1664.  
  1665.  /N      Specifies a "name" or title for
  1666.          the help files, subsequently
  1667.          available to applications via
  1668.          the HelpGetInfo interface.
  1669.          Multiple word titles may be
  1670.          enclosed in quotes.
  1671.  
  1672.  /D      Decodes a help file. The
  1673.          destination file need not be
  1674.          present, in which case the help
  1675.          file is decoded to standard
  1676.          output. Help files are decoded
  1677.          into QuickHelp ASCII format.
  1678.  
  1679.          Option                            Effect
  1680.  
  1681.          /DS                               "Decode split." Splits a
  1682.  Option  Action
  1683.  ────────────────────────────────────────────────────────────────────────────
  1684.         /DS                               "Decode split." Splits a
  1685.                                            concatenated help file back into
  1686.                                            its component files. No actual
  1687.                                            decoding is done, as the
  1688.                                            resulting help files, written to
  1689.                                            their original file names (as
  1690.                                            encoded in each help-file header)
  1691.                                            remain compressed.
  1692.  
  1693.          /DU                               "Decode unformatted." Creates a
  1694.                                            plain ASCII text file from a
  1695.                                            help file. All formatting
  1696.                                            information, such as color and
  1697.                                            cross-referencing, is lost
  1698.                                            except for .context statements.
  1699.  
  1700.  /T      Translates between topic
  1701.          commands in "English"
  1702.          dot-command form, and the terser
  1703.  Option  Action
  1704.  ────────────────────────────────────────────────────────────────────────────
  1705.         dot-command form, and the terser
  1706.          form. See the section in Chapter
  1707.          2 on topic commands for more
  1708.          details. This switch is valid in
  1709.          both encoding and decoding.
  1710.  
  1711.  /H      Causes HELPMAKE to display a
  1712.          summary of usage and exit.
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  Chapter 4  Applications Interface
  1722.  ────────────────────────────────────────────────────────────────────────────
  1723.  
  1724.  The embedded help library provides the following functionality to client
  1725.  applications:
  1726.  
  1727.  
  1728.    ■   Help-file location and multiple file management (Open, Close)
  1729.  
  1730.    ■   Context look-up and help topic retrieval
  1731.  
  1732.    ■   Browsing functions (Next, Back)
  1733.  
  1734.    ■   Display utilities
  1735.  
  1736.  
  1737.  
  1738.  4.1  Defining the Interface
  1739.  
  1740.  The help "engine" is a library of database tools that control retrieval of
  1741.  text based on reference words (context strings), indexes (context numbers),
  1742.  or position. The applications interface is to this help engine. This section
  1743.  defines the help engine's procedural interface. The engine handles the
  1744.  decompression of the help file and physical file I/O.
  1745.  
  1746.  Term                              Definition
  1747.  ────────────────────────────────────────────────────────────────────────────
  1748.  Convention                        All routines are FAR PASCAL.
  1749.  
  1750.  Pointers                          All pointers are FAR.
  1751.  
  1752.  "nc" type                         An unsigned long "context number." All
  1753.                                    referenceable keywords or phrases
  1754.                                    (contexts) map to context numbers. A
  1755.                                    context number identifies both the
  1756.                                    source help file and the help context
  1757.                                    itself.
  1758.  
  1759.  "f" type                          A Boolean.
  1760.  
  1761.  "PB" type                         A "pointer to a buffer." In most
  1762.                                    versions of the help engine, this is a
  1763.                                    far pointer (void far *). In
  1764.                                    handle-based versions of the engine,
  1765.                                    this is a long, containing a memory
  1766.                                    handle in the upper word, and an offset
  1767.                                    in the lower word. The memory handle is
  1768.                                    passed to HelpLock for dereferencing,
  1769.                                    and the offset is then added to the
  1770.                                    result to form the actual physical
  1771.                                    memory address used by the help engine.
  1772.  
  1773.  
  1774.  4.2  Base File Management
  1775.  
  1776.  
  1777.  HelpOpen
  1778.  
  1779.    nc pascal far HelpOpen (char far *lpszName)
  1780.  
  1781.  Given a help-file name, this function opens a help file and returns an
  1782.  initial context, or an error code on failure. Up to 25 help files can be
  1783.  open at a time. The application-provided routine OpenFileOnPath is used to
  1784.  open the file; typically that routine uses the PATH environment variable to
  1785.  locate the file.
  1786.  
  1787.  The value returned by HelpOpen, if less than HELPERR_MAX (defined in
  1788.  HELP.H), is an error code that displays the reason the file could not be
  1789.  opened.
  1790.  
  1791.  Concatenated help files count against the upper help-file limit once for
  1792.  each concatenated portion. The initial context returned is the context for
  1793.  the first physical topic in the help file. HelpOpen itself does not attempt
  1794.  to automatically append any extension to the file name.
  1795.  
  1796.  
  1797.  HelpClose
  1798.  
  1799.    void pascal far HelpClose (nc ncCur)
  1800.  
  1801.  Given a context, this function closes the help file associated with it and
  1802.  deallocates all associated memory. Calling with  ncCur  of zero closes all
  1803.  open help files.
  1804.  
  1805.  
  1806.  4.3  Context String Management
  1807.  
  1808.  
  1809.  HelpNc
  1810.  
  1811.    nc pascal far HelpNc (char far *lpszContext, nc ncInitial)
  1812.  
  1813.  Given a pointer to a context string, this function looks up the word and
  1814.  returns its nonzero context number. This can be used as a Boolean, returning
  1815.  FALSE if a help entry does not exist for that context string.
  1816.  
  1817.  Here,  ncInitial  is the context from which the search for the help topic
  1818.  begins. This context references a particular help file and help topic, and
  1819.  the search commences there.
  1820.  
  1821.  Where concatenated help files are used and  ncInitial  references something
  1822.  other than the first of the concatenated files, those preceding it are not
  1823.  searched. Similarly, if  ncInitial  references a help context in the middle
  1824.  of the help file, those contexts preceding it will not be searched.
  1825.  
  1826.  The initial context returned by HelpOpen (which references the first topic
  1827.  in the file), should be saved and used for this call.
  1828.  
  1829.  Context strings are of the form
  1830.  
  1831.    [filename!][context]
  1832.  
  1833.  where  filename  is the help file containing the cross-reference and allows
  1834.  cross-references to cross help files. The help file is located at reference
  1835.  time by using HelpOpen, and thus is located on the PATH;  context  is the
  1836.  context string to be referenced. If no context is present, then  filename!
  1837.  must be present, and the file is assumed to be unformatted ASCII and to
  1838.  contain the entire topic.
  1839.  
  1840.  Context strings may also be of an internal form returned by HelpXref. See
  1841.  HelpXref in Section 4.7 for more details.
  1842.  
  1843.  
  1844.  HelpNcCmp
  1845.  
  1846.    nc pascal far HelpNcCmp (char far *fpszContext,nc ncInitial,
  1847.                             f (pascal far *lpfnCmp) (uchar far *,
  1848.                                uchar far *, ushort, f, f));
  1849.  
  1850.  Like HelpNc, when given an ASCII string, this function determines the
  1851.  context number of that string. HelpNcCmp uses a caller-supplied comparison
  1852.  routine; lpfnCmp  is a far pointer to the comparison routine that takes the
  1853.  following parameters:
  1854.  
  1855.  Parameter                         Description
  1856.  ────────────────────────────────────────────────────────────────────────────
  1857.  fpsz1                             Far pointer to string 1. Normally the
  1858.                                    constant string being "looked up."
  1859.  
  1860.  fpsz2                             Far pointer to string 2. This is usually
  1861.                                    a string in the help file's string table
  1862.                                    (compressed) or an actual segment of the
  1863.                                    help file (formatted ASCII) being
  1864.                                    searched.
  1865.  
  1866.  cbCmp                             Maximum number of bytes to compare.
  1867.                                    Normally the strings above are
  1868.                                    zero-terminated, and this value is
  1869.                                    passed as 255. In ASCII files, this
  1870.                                    value may represent the number of bytes
  1871.                                    in the second string actually being
  1872.                                    compared. This value can be used as a
  1873.                                    max comparison count, regardless of file
  1874.                                    type.
  1875.  
  1876.  fCase                             TRUE if search is to be case insensitive.
  1877.                                    This is the setting of the case
  1878.                                    sensitivity flag in the help file being
  1879.                                    processed.
  1880.  
  1881.  fTerm                             TRUE if special termination processing
  1882.                                    is allowed. In this case, if any white
  1883.                                    space is encountered in the second
  1884.                                    string when NULL is found in the first,
  1885.                                    a match is declared.
  1886.  
  1887.  
  1888.  HelpSzContext
  1889.  
  1890.    f pascal far HelpSzContext (char far *pBuffer, nc ncCur)
  1891.  
  1892.  Given a context and a pointer to a buffer, this function places the first
  1893.  context string associated with that help topic in the buffer and returns
  1894.  TRUE on success.
  1895.  
  1896.  The format of the string is as described for HelpNc, except that the
  1897.  file-name part is always present (but does not include any leading path).
  1898.  The file-name part references the original file name created by HELPMAKE,
  1899.  not the current open file name if the help file was renamed, or if the file
  1900.  was concatenated with other help files.
  1901.  
  1902.  
  1903.  4.4  Topic Look-Up and Decompression
  1904.  
  1905.  
  1906.  HelpNcCb
  1907.  
  1908.    unsigned pascal far HelpNcCb (nc nContext)
  1909.  
  1910.  Given a context number, this function returns the size in bytes of the
  1911.  compressed topic.
  1912.  
  1913.  
  1914.  HelpLook
  1915.  
  1916.    unsigned pascal far HelpLook (nc nContext, PB pbDest)
  1917.  
  1918.  Given a context number, this function places the topic text into the passed
  1919.  buffer, which must be of sufficient size. HelpLook returns count of bytes in
  1920.  an uncompressed topic or zero on error.
  1921.  
  1922.  
  1923.  HelpDecomp
  1924.  
  1925.    f pascal far HelpDecomp (PB pbTopic, PB pbDest, nc ncContext)
  1926.  
  1927.  Given a compressed topic as returned by HelpLook (above) and its context
  1928.  number, this function decompresses it into the destination buffer. The
  1929.  decompressed text in the destination buffer is prefixed by the following
  1930.  topic header structure:
  1931.  
  1932.    typedef struct {
  1933.     uchar appchar;
  1934.     uchar linchar;
  1935.     uchar filetype;
  1936.     ushort reserved[2];
  1937.     } topichdr;
  1938.  
  1939.  where uchar is defined as follows:
  1940.  
  1941.  Character                         Description
  1942.  ────────────────────────────────────────────────────────────────────────────
  1943.  appchar                           The character specified by the /A switch
  1944.                                    when the help file was created by
  1945.                                    HELPMAKE.
  1946.  
  1947.  linchar                           Line-removal character. Lines beginning
  1948.                                    with this character are ignored by the
  1949.                                    HelpGet routines described in Section
  1950.                                    4.6.
  1951.  
  1952.  filetype                          The type of file that the topic came
  1953.                                    from. Values are:
  1954.  
  1955.                                    0           Unformatted ASCII
  1956.  
  1957.                                    1           Minimally formatted ASCII
  1958.  
  1959.                                    3           Fully compressed
  1960.  
  1961.  reserved                          Reserved for use by the HelpGet routines
  1962.                                    (see Section 4.6).
  1963.  
  1964.  Access to this data structure is currently present for compatibility only
  1965.  (see HelpCtl for manipulation of the  linchar  byte). HelpDecomp returns
  1966.  TRUE on error.
  1967.  
  1968.  
  1969.  4.5  Context Maneuvering
  1970.  
  1971.  
  1972.  HelpNcNext
  1973.  
  1974.    nc pascal far HelpNcNext (nc ncCur)
  1975.  
  1976.  Given a context, this function returns the context number for the next help
  1977.  topic, or NULL on catastrophic failure.
  1978.  
  1979.  
  1980.  HelpNcPrev
  1981.  
  1982.    nc pascal far HelpNcPrev (nc ncCur)
  1983.  
  1984.  Given a current context, this function returns the context number for the
  1985.  "physically previous" help topic in the help file, or NULL on catastrophic
  1986.  failure.
  1987.  
  1988.  This function is present for those applications that present a "previous"
  1989.  function in a physical, rather than historical, manner.
  1990.  
  1991.  
  1992.  HelpNcRecord
  1993.  
  1994.    void pascal far HelpNcRecord (nc ncCur)
  1995.  
  1996.  The HelpNcRecord function records a context number in the help engine
  1997.  backtrace list. Numbers are not automatically recorded by the help engine,
  1998.  but must be explicitly recorded by client applications. This routine and
  1999.  HelpNcBack (below) maintain a Last In First Out (LIFO) list of context
  2000.  numbers used to maintain the historical backtrace list.
  2001.  
  2002.  
  2003.  HelpNcBack
  2004.  
  2005.    nc pascal far HelpNcBack ()
  2006.  
  2007.  Given a current context, this function returns the context number for the
  2008.  "historically previous" help topic. These are the context numbers previously
  2009.  saved by calls to HelpNcRecord.
  2010.  
  2011.  
  2012.  HelpNcUniq
  2013.  
  2014.    nc pascal far HelpNcUniq (nc ncCur);
  2015.  
  2016.  The HelpNcUniq function transforms a context number into a context number
  2017.  guaranteed unique for each topic in the file. That is, given that many
  2018.  context strings (and hence many context numbers) may map to the same topic,
  2019.  HelpNcUniq transforms all the context numbers that refer to a particular
  2020.  topic into the same context number. The information on the context string
  2021.  originally used is lost. This function returns NULL on any error.
  2022.  
  2023.  
  2024.  4.6  Topic Display
  2025.  
  2026.  Help text returned by the help engine contains encoding information. The
  2027.  following routines are provided to aid interpretation.
  2028.  
  2029.  
  2030.  HelpGetCells
  2031.  
  2032.    int pascal far HelpGetCells (ushort ln ,int cbMax , PB pbDst,
  2033.  
  2034.                                 uchar far *pbTopic, uchar far *prgAttr)
  2035.  
  2036.  HelpGetCells interprets the help file's stored format and returns character
  2037.  and attribute information a line at a time.
  2038.  
  2039.  Character                         Description
  2040.  ────────────────────────────────────────────────────────────────────────────
  2041.  ln                                The one-based line number to return.
  2042.  
  2043.  cbMax                             The maximum number of bytes to transfer.
  2044.  
  2045.  pbDst                             A pointer to the destination.
  2046.  
  2047.  pbTopic                           A pointer to the topic text.
  2048.  
  2049.  prgAttr                           A pointer to array of character
  2050.                                    attributes. Internal attribute indexes
  2051.                                    are mapped to physical attributes
  2052.                                    through this table.
  2053.  
  2054.  Returns number of characters transferred, or -1 if that line does not exist.
  2055.  
  2056.  
  2057.  
  2058.  HelpGetLine
  2059.  
  2060.    ushort pascal far HelpGetLine (ushort ln, ushort cbMax,
  2061.                                  char far *pszDst, PB pbTopic);
  2062.  
  2063.  This function interprets the format of a topic previously read and
  2064.  decompressed and returns ASCII text a line at a time.
  2065.  
  2066.  The HelpGetLine function places characters into pszDst up to cbMax-1 for the
  2067.  line specified by ln in the help topic pointed to by pbTopic. The line is
  2068.  zeroterminated and the function returns the number of characters placed in
  2069.  buffer.
  2070.  
  2071.  
  2072.  HelpGetLineAttr
  2073.  
  2074.    ushort pascal far HelpGetLineAttr (ushort ln, ushort cbMax,
  2075.                                       LINEATTR far *rgAttrs,
  2076.                                       PB pbTopic);
  2077.  
  2078.  This function fills rgAttrs buffer with line attributes for a line defined
  2079.  by ln. A line attribute is a word containing an attribute index followed by
  2080.  count of characters of the attribute.
  2081.  
  2082.    LineAttr      STRUC
  2083.        LA_attr   dw       ?      ;color attribute
  2084.        LA_cb     dw       ?      ;count of chars
  2085.                                  ;with attribute
  2086.    LineAttr      ENDS
  2087.  
  2088.  The array rgAttr may be terminated by an attribute of FFFF. Alternatively,
  2089.  if cb is FFFF, the attribute is used for the rest of the line. cbMax is the
  2090.  maximum size for the rgAttr buffer, and the function returns 0 if the buffer
  2091.  is too small for attributes; otherwise, it returns nonzero.
  2092.  
  2093.  
  2094.  HelpcLines
  2095.  
  2096.    int pascal far HelpcLines (PB pbTopic);
  2097.  
  2098.  This function returns the number of text lines in the topic pointed to by
  2099.  pbTopic.
  2100.  
  2101.  
  2102.  4.7  Cross-References
  2103.  
  2104.  
  2105.  HelpXRef
  2106.  
  2107.    char far * pascal far HelpXRef (PB pbTopic, hotspot far *photspot)
  2108.  
  2109.  Given a row, column (in the hotspot structure defined below), and topic,
  2110.  this function returns a pointer to a cross-reference string. pbTopic is the
  2111.  pointer to the topic text, and photspot is a pointer to a hotspot structure
  2112.  to update.
  2113.  
  2114.  The HelpXRef function returns a far pointer into the topic text of a
  2115.  cross-reference string and updates the contents of the hotspot structure. It
  2116.  returns NULL if no cross-reference exists for that line.
  2117.  
  2118.  A "hotspot" structure defines the position of an embedded cross-reference,
  2119.  defined as follows:
  2120.  
  2121.    typedef struct {
  2122.        ushort line;  /* the topic line with an xref  */
  2123.        ushort col;  /* the starting column of xref  */
  2124.        ushort ecol;  /* the ending column of xref  */
  2125.        uchar far *pXref;   /* pointer to xref string  */
  2126.        } hotspot;
  2127.  
  2128.  ────────────────────────────────────────────────────────────────────────────
  2129.  IMPORTANT
  2130.  
  2131.  The cross-reference string can take either of two forms: a normal,
  2132.  nullterminated ASCII string, or a three-byte data structure whose first byte
  2133.  is NULL. It is important that the first byte be checked before copying the
  2134.  string, because normal string copy routines will not copy the three-byte
  2135.  data structure correctly. (The three-byte data structure is a
  2136.  cross-reference to a "local context.")
  2137.  ────────────────────────────────────────────────────────────────────────────
  2138.  
  2139.  
  2140.  HelpHlNext
  2141.  
  2142.    f pascal far HelpHlNext (int cLead, PB pbTopic,
  2143.                            hotspot far *photspot);
  2144.  
  2145.  This function locates the next cross-reference in the help topic. Given a
  2146.  starting position in the passed hotspot structure, HelpHlNext locates either
  2147.  the next physical cross-reference, or the next reference beginning with a
  2148.  particular character (case insensitive); it locates either forward or
  2149.  backward.
  2150.  
  2151.  One of the following can be  cLead:
  2152.  
  2153.  NULL                              The next hot-link searching forward from
  2154.                                    the specified position is returned.
  2155.  
  2156.  -1                                The next hot-link searching backward
  2157.                                    from the specified position is returned.
  2158.  
  2159.  char                              If positive and non-NULL, the next
  2160.                                    hot-link following the specified
  2161.                                    position whose on-screen keyword begins
  2162.                                    with the character  cLead  is returned (
  2163.                                    cLead  must be uppercase).
  2164.  
  2165.  -char                             If negative and not -1, the next
  2166.                                    hot-link before the specified position
  2167.                                    whose on-screen keyword begins with the
  2168.                                    character  -cLead  is returned (cLead
  2169.                                    must be uppercase).
  2170.  
  2171.  Here,  pbTopic  is a pointer to the topic text;  photspot  is a pointer to a
  2172.  hotspot structure to receive information; line  and  col  indicate a
  2173.  starting point.
  2174.  
  2175.  The HelpHlNext function returns TRUE if a cross-reference is found or if a
  2176.  hotspot structure is updated; it returns NULL if no such cross-reference.
  2177.  
  2178.  
  2179.  4.8  Utility
  2180.  
  2181.  
  2182.  HelpCtl
  2183.  
  2184.    void pascal far HelpCtl (PB pbTopic, flag);
  2185.  
  2186.  Here,  pbTopic  is a pointer to the topic text about to be retrieved. If the
  2187.  flag is TRUE, HelpGetLine (and family) subsequently returns all lines of
  2188.  text in the topic. If the flag is FALSE, HelpGetLine returns only those
  2189.  lines that do not begin with the application-specific control character, as
  2190.  specified by the /A parameter to HELPMAKE when the file was compressed.
  2191.  (HelpGetLine "and family" refers to all line-retrieval, cross-reference, and
  2192.  line-counting routines that operate on the decompressed topic text.)
  2193.  
  2194.  ────────────────────────────────────────────────────────────────────────────
  2195.  NOTE
  2196.  
  2197.  HelpCtl is provided to clarify the speed-optimization behavior in these
  2198.  routines. The current method in most applications is to replace a character
  2199.  in the topic header (setting it to FF) prior to calling the line-retrieval
  2200.  routines, which confuses the optimization. This new interface hides the
  2201.  internal data structures that would otherwise also be modified.
  2202.  ────────────────────────────────────────────────────────────────────────────
  2203.  
  2204.  
  2205.  HelpGetInfo
  2206.  
  2207.    int pascal far HelpGetInfo (struct helpinfo far *fpDest,
  2208.                                int cbDest);
  2209.  
  2210.  This utility copies a  helpinfo  structure relating to the specified nc to
  2211.  the specified buffer. Here, cbDest  is the maximum length of the data to be
  2212.  copied. If HelpGetInfo cannot copy the data because the buffer is too small,
  2213.  it returns the required buffer size. Otherwise, it returns 0, indicating
  2214.  success.
  2215.  
  2216.  
  2217.  HelpInit
  2218.  
  2219.    void pascal far HelpInit (void)
  2220.  
  2221.  This call initializes data internal to the help engine. It should be called
  2222.  once, at program startup.
  2223.  
  2224.  ────────────────────────────────────────────────────────────────────────────
  2225.  NOTE
  2226.  
  2227.  This function is used only in versions of the help library that do not have
  2228.  preinitialized data. For convenience, all libraries distributed outside of
  2229.  Microsoft have initialized data (this function is not included).
  2230.  ────────────────────────────────────────────────────────────────────────────
  2231.  
  2232.  
  2233.  HelpShrink
  2234.  
  2235.    void pascal far HelpShrink (void)
  2236.  
  2237.  When called, this function causes the help engine to free all memory whose
  2238.  data can be regenerated. This frees up indexes and keyword tables loaded
  2239.  from help files. The next help access can cause one or more of these tables
  2240.  to be reloaded. If there are no open help files, the engine has no memory
  2241.  allocated, and this call does nothing.
  2242.  
  2243.  
  2244.  4.9  Help Engine Callbacks
  2245.  
  2246.  The help engine requires some support from the application environment for
  2247.  file and memory management.
  2248.  
  2249.  In the discussions below, "mh" is an unsigned short memory handle. "DOS
  2250.  only" indicates that the call is used only in those versions of the help
  2251.  engine that are run under MS-DOS, and not in OS/2-specific versions.
  2252.  
  2253.  Because of the limitations of some client applications, memory management
  2254.  within the help engine is such that the engine holds no locked memory when
  2255.  an allocation is performed.
  2256.  
  2257.  
  2258.  HelpAlloc
  2259.  
  2260.    mh pascal far HelpAlloc (ushort cbMem)
  2261.  
  2262.  This function allocates a block of memory. The memory may be movable, and
  2263.  outside of the default data segment. HelpAlloc returns NULL on failure, or
  2264.  if cbMem  is 0. DOS only.
  2265.  
  2266.  
  2267.  HelpDealloc
  2268.  
  2269.    void pascal far HelpDealloc (mh)
  2270.  
  2271.  This function deallocates a block of memory. DOS only.
  2272.  
  2273.  
  2274.  HelpLock
  2275.  
  2276.    char far * pascal far HelpLock (mh)
  2277.  
  2278.  This function returns a far pointer to the base of the memory referenced by
  2279.  the handle. In the case of movable memory, the memory is also locked. If the
  2280.  memory handle passed is invalid or NULL, NULL should be returned. DOS only.
  2281.  
  2282.  
  2283.  
  2284.  HelpUnlock
  2285.  
  2286.    void pascal far HelpUnlock (mh)
  2287.  
  2288.  This function unlocks the memory referenced by the handle. DOS only.
  2289.  
  2290.  
  2291.  OpenFileOnPath
  2292.  
  2293.    fhandle pascal far OpenFileOnPath (char *fname, f fWrite);
  2294.  
  2295.  The file name is of the following form:
  2296.  
  2297.    [$ENVVAR: | path]filename.ext
  2298.  
  2299.  If                                Then
  2300.  ────────────────────────────────────────────────────────────────────────────
  2301.  $ENVVAR:  is present              The file does not exist in the current
  2302.                                    directory; it should be located on the
  2303.                                    path-formatted environment variable
  2304.                                    specified.
  2305.  
  2306.  path  is not present              The file does not exist in the current
  2307.                                    directory; it should be located on the
  2308.                                    PATH environment variable.
  2309.  
  2310.  path  is present                  The file is simply opened. DOS only.
  2311.  
  2312.  
  2313.  ReadHelpFile
  2314.  
  2315.    ulong pascal far ReadHelpFile (int fhandle, ulong fpos, char
  2316.    far *pData, ushort cbBytes);
  2317.  
  2318.  ReadHelpFile reads  cbBytes  of data, placing it beginning at  pData  from
  2319.  the file whose handle is  fhandle, beginning at file offset  fpos. It
  2320.  returns the number of bytes read.
  2321.  
  2322.  If  cbBytes  is zero, then the routine should return the size in bytes of
  2323.  the referenced file. DOS only.
  2324.  
  2325.  
  2326.  HelpCloseFile
  2327.  
  2328.    void pascal far HelpCloseFile (int fhandle)
  2329.  
  2330.  This function closes the file whose handle is passed. DOS only.
  2331.  
  2332.  
  2333.  Callback Notes
  2334.  
  2335.  Each call by an application to HelpOpen results in a call by the engine to
  2336.  OpenFileOnPath if the file referenced is not already open. CloseFile will
  2337.  not be called until a HelpClose operation is performed on that file.
  2338.  
  2339.  To reduce the number of concurrently open file handles (for applications
  2340.  which support multiple simultaneous help files), the handle returned by
  2341.  HelpOpen (and used by ReadHelpFile and CloseFile) should be a "virtual"
  2342.  handle. Also, some form of currently open file "handle caching" should be
  2343.  performed. By keeping only the most recently accessed file physically open
  2344.  at the DOS level, and by closing or opening when a request against a new
  2345.  virtual handle is made, the help system can be guaranteed to only have one
  2346.  file handle open at a time.
  2347.  
  2348.  
  2349.  4.10  Interface Usage
  2350.  
  2351.  For simple context-string-to-help-topic-text retrieval, the following steps
  2352.  outline the process. Assume that the help file has been opened via HelpOpen:
  2353.  
  2354.  
  2355.  
  2356.    1.  Call HelpNc to get a context number for the string on which help is
  2357.        desired.
  2358.  
  2359.    2.  Call HelpNcCb to determine the amount of memory required by the
  2360.        compressed topic. If appropriate, allocate this memory.
  2361.  
  2362.    3.  Call HelpLook to retrieve the compressed topic from the help file.
  2363.        This call also returns the size of the uncompressed topic. If
  2364.        appropriate, allocate this memory.
  2365.  
  2366.    4.  Call HelpDecomp to decompress the topic text. Once completed, the
  2367.        memory for the compressed topic text may be deleted.
  2368.  
  2369.    5.  Call HelpGetCells or HelpGetLine and HelpGetLineAttr to extract the
  2370.        topic text and formatting information one line at a time.
  2371.  
  2372.  
  2373.  Given any valid context number returned by the help engine, you can also:
  2374.  
  2375.  
  2376.    1.  Call HelpNcNext to get the context number for the next sequential
  2377.        topic in the file.
  2378.  
  2379.    2.  Call HelpNcPrev to get the context number for the previous sequential
  2380.        topic in the file.
  2381.  
  2382.    3.  Use HelpNcRecord and HelpNcBack to manage a history list of context
  2383.        numbers.
  2384.  
  2385.  
  2386.  
  2387.  
  2388.  
  2389.  
  2390.  
  2391.  Chapter 5  Size and Performance
  2392.  ────────────────────────────────────────────────────────────────────────────
  2393.  
  2394.  
  2395.  5.1  Help Engine
  2396.  
  2397.  The help engine itself varies in size based on functions used (and hence
  2398.  linked in) and on memory model or environment selected. In general, it
  2399.  ranges in size from 4K to 6K of code. In addition, the application requires
  2400.  around 4K of code to interface the help engine to its own environment.
  2401.  
  2402.  The help engine maintains 104 bytes of static data. All other data is
  2403.  allocated dynamically, based on the number of help files being opened. For
  2404.  each help file open, 115 bytes of dynamic memory is allocated. This memory
  2405.  is not freed until the file is actually closed with the HelpClose function.
  2406.  Note also that concatenated files count separately. That is, each
  2407.  concatenated portion counts as a single separate file.
  2408.  
  2409.  When accessing a help file, several tables are read in from the actual help
  2410.  file. These tables are discardable under most circumstances by calling
  2411.  HelpShrink. The tables vary in size based on the size of the help file
  2412.  itself. The information in Table 5.1 presents the relevant numbers for the
  2413.  file QC.HLP, a file shipped with QuickC 2.0, and some indication of what
  2414.  each is dependent on.
  2415.  
  2416.  At decompression time, the Keyphrase and Huffman tables must be resident in
  2417.  memory simultaneously. This is checked by the engine. In all other cases,
  2418.  HelpShrink may be called during HelpAlloc to discard unneeded or rebuildable
  2419.  memory.
  2420.  
  2421.  At decompression time, memory is also required for both the compressed and
  2422.  decompressed topic texts.
  2423.  
  2424.  Table 5.1  QC.HLP File Information
  2425.  
  2426. ╓┌────────────────┌────────────────┌─────────────────────────────────────────╖
  2427.  Type             Size (in Bytes)  Description
  2428.  ────────────────────────────────────────────────────────────────────────────
  2429.  File size        355,940          Dependent on all of the tables below,
  2430.                                    plus the volume of help actually
  2431.                                    provided. File size has no bearing on
  2432.                                    the memory requirements of applications.
  2433.  
  2434.  Topic index      3,084            Four times the number of help topics in
  2435.                                    the file. QC.HLP has 771 topics.
  2436.  
  2437.  Context strings  4,700            Total length of all context strings
  2438.  Type             Size (in Bytes)  Description
  2439.  ────────────────────────────────────────────────────────────────────────────
  2440. Context strings  4,700            Total length of all context strings
  2441.                                    supported by the help file.
  2442.  
  2443.  Context map      1,168            Two times the number of context strings
  2444.                                    supported. QC.HLP has 584 context
  2445.                                    strings.
  2446.  
  2447.  Keyphrase table  8,087            Number plus 2,048 actually allocated at
  2448.                                    decompression time. This table is
  2449.                                    proportional to the size of the
  2450.                                    compressible key phrases identified in
  2451.                                    the file at compression time. This is
  2452.                                    limited to 1,024 words, but the
  2453.                                    individual words may be of arbitrary
  2454.                                    length.
  2455.  
  2456.  Huffman table    1,024            Occasionally smaller than this, but in
  2457.                                    most cases quickly growing to this size.
  2458.                                    It is never larger.
  2459.  Type             Size (in Bytes)  Description
  2460.  ────────────────────────────────────────────────────────────────────────────
  2461.                                   It is never larger.
  2462.  
  2463.  ────────────────────────────────────────────────────────────────────────────
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  5.2  HELPMAKE.EXE
  2469.  
  2470.  HELPMAKE.EXE is a bound program around 60K in size. It requires 256K
  2471.  available memory to run. When compressing, it requires free disk space up to
  2472.  2.5 times the size of the input file(s).
  2473.  
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  Glossary
  2481.  ────────────────────────────────────────────────────────────────────────────
  2482.  
  2483.  Advisor
  2484.  The Microsoft Advisor is the name given to the help system as actually
  2485.  implemented in many Microsoft language products.
  2486.  
  2487.  Application-Specific Character
  2488.  A character agreed upon by the applications developer and help-file author
  2489.  that signifies that the rest of the line following it is a topic command
  2490.  line, and not a line of actual help text to be displayed. Specified to
  2491.  HELPMAKE using the /A parameter.
  2492.  
  2493.  Context
  2494.  A keyword or phrase which is recognized by the help system and relates to a
  2495.  topic.
  2496.  
  2497.  Context Map
  2498.  A table which maps a context number to a topic index.
  2499.  
  2500.  Context Number
  2501.  A number in the range 1-32,767 that uniquely identifies a context.
  2502.  
  2503.  Cross Reference
  2504.  A string associated with a "hotspot" or location in displayed help text.
  2505.  When activated, the cross-reference string may reference another help
  2506.  context or help file, or it may cause the application to take some other
  2507.  kind of action.
  2508.  
  2509.  Cross-Reference Command
  2510.  A context string which, when looked up by the application, usually in
  2511.  response to a hotspot selection, does not cause additional help to be
  2512.  retrieved. Instead it executes a DOS command or causes some other
  2513.  application-specific action to occur.
  2514.  
  2515.  Dot Command
  2516.  English form of topic command used within QuickHelp-formatted databases.
  2517.  
  2518.  Executable Context
  2519.  See Cross-Reference Command.
  2520.  
  2521.  Executable Cross-Reference Command
  2522.  See Cross-Reference Command.
  2523.  
  2524.  Help Database
  2525.  The single compressed file output by HELPMAKE. Also, that single help file,
  2526.  when concatenated with others.
  2527.  
  2528.  Help File
  2529.  A collection of one or more help databases that constitutes a single
  2530.  physical file. Also, a single minimally formatted ASCII file.
  2531.  
  2532.  Help Item
  2533.  See Topic.
  2534.  
  2535.  Help Screen
  2536.  An application-provided window on a single topic. A help screen should be
  2537.  scrollable to allow viewing of the entire topic, should it exceed the size
  2538.  of a single screen.
  2539.  
  2540.  Hotspot
  2541.  The location in topic text to which a cross-reference has been attached.
  2542.  Hotspots are normally highlighted in some fashion when displayed, and define
  2543.  areas within the displayed topic that activate the cross-reference when
  2544.  selected.
  2545.  
  2546.  Keyphrase
  2547.  A word or phrase extracted from the help text and replaced by a token during
  2548.  compression.
  2549.  
  2550.  Label
  2551.  See Context String.
  2552.  
  2553.  Local Context
  2554.  A context that has no associated context string in the help file, and is
  2555.  referenced only by a hotspot elsewhere in the same help file.
  2556.  
  2557.  Node
  2558.  See Topic.
  2559.  
  2560.  Node Name
  2561.  See Context String.
  2562.  
  2563.  RTF
  2564.  Rich Text Format. An ASCII text format for storing documents and their
  2565.  formatting information.
  2566.  
  2567.  Script Topic
  2568.  A topic whose contents are executable cross-reference commands.
  2569.  
  2570.  Topic
  2571.  The text displayed as a help entry. May be up to 64K of encoded text.
  2572.  
  2573.  Topic Command
  2574.  A control line embedded into help text which contains control information or
  2575.  instructions for the application displaying help, as opposed to help text to
  2576.  be displayed.
  2577.  
  2578.  Topic Index
  2579.  A number corresponding to a sequential topic entry in the help file. Also,
  2580.  the table that maps these numbers to actual file positions.
  2581.  
  2582.