Implementing Online Help

How you call online help from Uniface depends on the format of the help file.

The most commonly used locations for implementing online help calls are:

  • The help trigger of a field or entity to provide information about the current context. For example, when the user presses F1, the ^HELP structure editor function fires the trigger for the current field (if it is defined) or for the current entity).

  • The detail trigger of a CommandButton. This can also provide help about the current context,

  • The option trigger of a menu item. This is usually used to display a generic help page or the main page of a help system.

To implement online help:

  1. Create the help messages or files.

    For HTML, WinHelp, or Microsoft HTML Help, you can use the third-party tool of your choice.

  2. To call a Uniface help text:
    1. Use the help ProcScript statement to specify the help text to be called.
    2. Ensure that the appropriate language and library are defined for the help text, either in ProcScript or in the assignment file.
    trigger help
      $variation = myapp
      $language = usa
      help $text(HLP523)
    end; help
  3. To call an HTML topic:
    1. Specify the help topic to be called using the help ProcScript function.

      For example:

      help/topic "hlpTopic523"

      hlpTopic523 is the topic name.

    2. Set the location of the help file in the application .ini file using HELPDIR. HelpDir

      For example:

      [paths]
      helpdir=D:\myapp\help

    Uniface looks for a file in the specified directory with the name hlpTopic523.htm or hlpTopic523.html.

  4. To call a topic in a Microsoft HTML Help (.chm) file:
    1. Use the help/id ProcScript statement to specify the numeric context ID and the name of the CHM file.

      For example:

       help/id "523", "myapp.chm"
    2. Create a an .ini file that defines the mappings between the topic name and the context ID.

      This file should be located in the same directory as the CHM file. The contents of the file should conform to the following syntax:

      [keywords]
      TopicName=ContextID

      Tip:

      The contents of this file correspond to the .map file used when creating the CHM file.

      At runtime, this results in a single instance of the CHM file window being created within the same process as your application. All subsequent help calls are directed to this same instance.

  5. Alternatively, to call a topic in a Microsoft HTML Help (.chm) file you can use the spawn command to call the hh.exe executable with a parameter that specifies the file name, location, and the actual topic to be called with the file.

    HTML Help files are compressed HTML pages and can have their own internal directory structure. Use the following syntax:

    hh.exePath\ChmFile::/{InternalPath/}HtmlFile

    For example:

    spawn "hh.exe d:\myapp\help\myapp.chm::/basic/hlpTopic523.html"

    At runtime, this results in an instance of the help file being created for each help call.

  6. To call a topic in a WinHelp file (.hlp):
    1. Specify the help topic to be called using the help ProcScript function.

      For example:

      help /topic "hlpTopic523", "main"

      hlpTopic523 is the topic name, main is the logical file name.

    2. Edit the application .ini file.

      Define the location of the help files using the HTMLDIR setting and map the logical name ot the physical file in the [help] section.

      By default, Uniface assumes that help topics are in HTML format. To indicate otherwise, set HTMLHELP to false.

      For example:

      [paths]
      helpdir=D:\myapp\help
      
      [help]
      htmlhelp = false
      main = myapp.hlp

The following examples demonstrate how you can call Microsoft WinHelp. It is assumed that the .ini file contains the setting HTMLHELP=false.

  • help /topic "company", "comphelp"

    When executed, Uniface passes the topic name company to the native help system as a search key. The logical file name comphelp is used to find the real file name, as specified in the application’s .ini file.

  • To display an overview of the help file, such as an index or table of contents:

    Help /topic "","comphelp"

    Under Windows, this code displays the help system with the contents of the logical help file. If no logical help file is defined, Uniface tries to find the default help file as specified by the DEFAULT setting in the [HELP] section of the application .ini file.

  • The following ProcScript statement causes Uniface to search in the default help file for the "company" string.

    help /topic "company"
  • To get the index or contents of the default help file, use the following statement:

    help /topic ""

Related Topics