Providing online help for developers

You can provide your own online help for your user-defined functions, user events, and user objects into the PowerBuilder development environment.

How context-sensitive help for user-defined functions works

When you select the name of a function or place the cursor in the function name in the Script view and press Shift + F1:

  1. PowerBuilder looks for the standard prefix (the default is uf_) in the function name.

  2. If the standard prefix is found, PowerBuilder looks for the help topic in the help file containing your user-defined function help topics (instead of looking in PBUSR125.CHM, its own main help file). The default file name for help on user-defined functions is PBUSR125.CHM.

    PowerBuilder determines the name of the help file to look in by reading the UserHelpFile variable in PB.INI. For information on changing the value of this variable, see “Advanced procedures”.

  3. If PowerBuilder finds the variable, it looks in the specified help file for the name of the selected function. If there is no UserHelpFile variable in PB.INI, PowerBuilder looks for the keyword in the PBUSR125.CHM file in the PowerBuilder Help directory.

Simplest approach

If you work within the PowerBuilder defaults:

Basic procedures

Here are details on how to build online help into the PowerBuilder environment.

StepsTo create context-sensitive help for user-defined functions:

  1. When you create a user-defined function, give the name of the function a standard prefix. The default prefix is uf_ (for example, uf_calculate).

  2. For each user-defined function help topic, assign a search keyword (a K footnote entry) identical to the function name.

    For example, in the help topic for the user-defined function uf_CutBait, create a keyword footnote uf_CutBait. PowerBuilder uses the keyword to locate the correct topic to display in the help window.

  3. Compile the help file and save it in the PowerBuilder Help directory.

Advanced procedures

You can specify a different file name for context-sensitive help:

StepsTo specify a different file name for context-sensitive help:

  1. Open your PB.INI file in a text editor.

  2. In the [PB] section, add a UserHelpFile variable, specifying the name of the help file that contains your context-sensitive topics. Your help file must be in the PowerBuilder Help directory. The format of the variable is:

    UserHelpFile = helpfile.chm
    

    Specify only the file name. A full path name designation will not be recognized.

You can change the prefix of your user-defined functions:

StepsTo use a different prefix for user-defined functions:

  1. Open your PB.INI file in a text editor.

  2. In the [PB] section, add a UserHelpPrefix variable, specifying the value of your prefix. Use this format:

    UserHelpPrefix = yourprefix_
    

    The prefix must end with an underscore character.