Xbasic

{HELP}

Syntax

{HELP= Help_Filename : [ Help_ Topic_Name ] }

Arguments

Help_Filename

Character. The fully qualified name and path of the .CHM or .HLP file.

Topic_Name

Character. Optional. The name of the topic in the help file.

Description

The {HELP} command allows you to add context sensitive help to an xdialog. If you do not specify the Help_Topic_Name, the topic id in the last {Help} command encountered is used.

Example 

For example, the following command sets the help file and help topic: The help file name is c:\mya5data\myapp.hlp, and the topic id is topic_1. The {INCLUDE} command allows you to use a dynamically calculated Help_Filename. The following script displays a dialog. There is context sensitive help for each of the fields on the dialog. If the user presses the F1 key when 'Field 1' has focus, the help for 'Field 1' is displayed, and so on. If the user presses the 'Help' button, then help for the dialog as a whole is displayed.

This script makes reference to a help file called learningXdialog.hlp in the same folder as the Learning Xdialog folder. This help file has the following topic_id 's: field_1, field_2, and main_help.
help_file_name = a5.Get_Path()+"\learningxdialog.hlp"
field_1_help = "{help="+help_file_name+":"+"Field 1"+"}"
field_2_help = "{help="+help_file_name+":"+"Field 2"+"}"
ui_dlg_box("Title",<<%dlg%
{region}
{include=field_1_help}
Field 1: [.30field1];
{include=field_2_help}
Field 2: [.30field2]
{endregion}|
{region}
<*10&OK>;
<10&Cancel>;
<15&Help>
{endregion}
%dlg%,<<%code%
if a_dlg_button = "&Help" then
a_dlg_button = ""
ui_dlg_help(help_file_name+":Main Help")
end if
%code%)
images/XD_Help_Text.gif

When the user presses the F1 key, when Field 2 has focus, the following help screen is displayed.

images/Help Field 2.gif

When the user presses the Help button, the following help screen is displayed:

images/XD_Help Main Menu.gif

Limitations

Desktop applications only

See Also