ShowHelp

Description

Provides access to a Microsoft Windows-based Help system or to compiled HTML Help files that you have created for your PowerBuilder application. When you call ShowHelp, PowerBuilder starts the Help executable and displays the Help file you specify.

Syntax

ShowHelp ( helpfile, helpcommand {, typeid } )

Argument

Description

helpfile

A string whose value is the name of the compiled HLP file or the CHM (HTML Help) file.

helpcommand

A value of the HelpCommand enumerated type. Values are:

  • Finder! -- Displays the Help file in its most recently used state (the Help Topics dialog box in WinHelp or the Navigator pane in the HTML Help viewer open to the last-used tab or the default tab for the Help file).

  • Index! -- Displays the top-level contents topic in the Help file.

  • Keyword! -- Goes to the topic identified by the keyword in typeid.

  • Topic! -- Displays the topic identified by the number in typeid.

typeid

(optional)

A number identifying the topic if helpcommand is Topic! or a string whose value is a keyword of a help topic if helpcommand is Keyword!.

Do not specify typeid when helpcommand is Finder! or Index!.


Return value

Integer.

Returns 1 if it succeeds and -1 if an error occurs. ShowHelp returns -1 if you specify typeid when helpcommand is Finder! or Index!. If any argument's value is null, ShowHelp returns null.

Usage

To provide context-sensitive Help, use ShowHelp in appropriate scripts throughout your application with specific topic IDs or keywords.

If you specify Keyword! for helpcommand and the string in typeid is not unique, the Help Search window displays.

For information on how to create online Help files for your PowerBuilder application, see Providing Online Help for an Application in Application Techniques.

Examples

This statement displays the Help index in the INQ.HLP file:

ShowHelp("C:\PB\INQ.HLP", Index!)

This statement displays Help topic 143 in the file EMP.HLP file:

ShowHelp("EMP.HLP", Topic!, 143)

This statement displays the Help topic associated with the keyword Part# in the file EMP.HLP:

ShowHelp("EMP.HLP", Keyword!, "Part#")

This statement displays the Help search window. The word in the box above the keyword list is the first keyword that begins with M:

ShowHelp("EMP.HLP", Keyword!, "M")

See also

Help

ShowPopupHelp