VPLUS/Windows Context Numbers [ HP VPLUS/Windows Programmer's Guide ] MPE/iX 5.0 Documentation
HP VPLUS/Windows Programmer's Guide
VPLUS/Windows Context Numbers
The help writer maps help topics to context numbers in the help project
file. VPLUS/Windows predefines these context numbers based on
information in the forms file. VPLUS/Windows determines the context
number of a component by using the algorithms shown in Table 4-1.
Table 4-1. VPLUS/Windows Context Number Algorithms
--------------------------------------------------------------------------------------------
| | |
| Position of Pointer | Corresponding Context Number Algorithm |
| | |
--------------------------------------------------------------------------------------------
| | |
| Within a field | (form ordinal number * 1000) + field number |
| | |
| Within a key label | (form ordinal number * 1000) + 900 + function key number |
| | |
| Within the window line | (form ordinal number * 1000) + 999 |
| | |
| Within any other region | (form ordinal number * 1000) |
| | |
--------------------------------------------------------------------------------------------
For a form ordinal number of 3, a field number of 6, and a function key
number of 8, the context number for each of the pointer positions would
be as follows:
Within field number 6 on form 3 3006
Within the label for F8 on form 3 3908
Within the window line on form 3 3999
Within the screen text on form 3 3000
Definition of Terms
Definitions for form ordinal number, field number, and function key
number are as follows:
* Form ordinal number
This number is a permissible key in the form information buffer of
the VGETFORMINFO intrinsic and is assigned during the VPLUS FORMSPEC
compile function. The form ordinal number reflects the order of the
form within the forms file and is not a permanently assigned numeric
identifier.
Forms are ordered within the VPLUS forms file in USASCII alphabetic
order of the form name. Consequently, if you add a new form or
delete an existing form, this changes the ordinal numbers of some or
all of the forms. Modifying a form name can also affect the ordinal
number of the current form and other forms in the forms file.
Reordering of forms, which is caused by changes to the forms file,
becomes effective when you recompile the forms file.
* Field number
FORMSPEC defines this number for a field when you design the form
layout. The field number appears in the Field Menu of FORMSPEC. A
field, as defined by its field tag, retains its field number as long
as the field exists on the form. Moving the field location within
the form layout does not impact the field number. (You can only
change the field number if you use the RENUMBER batch mode command.
This FORMSPEC command renumbers all fields within a specified form
according to screen order, from left to right and top to bottom.)
* Function key number
This number is comparable to the lastkey variable within the COMAREA
parameter. The presentation server displays eight key labels
corresponding to the eight terminal function keys and displays an
Enter label corresponding to the terminal Enter key. The function
key number for the Enter key is zero. The function key numbers for
F1 through F8 are one through eight, respectively.
Providing Context Numbers
Whenever a form ordinal number or a field number changes, the
corresponding context numbers change. When the context numbers change,
you must include the new context numbers in the help project file and
recompile the help file on the PC. The VPLUS/Windows forms file
translation utility, VFFXLTPC, optionally generates a cross-reference
file to document the context numbers. Refer to "Running the Utility with
Options" in Chapter 2 for information about running VFFXLTPC to generate
a cross-reference file.
You can use the cross-reference file as input to the Microsoft Windows
Help compiler. The file contains a mapping of forms and form components
to context numbers. After the utility generates the cross-reference
file, the help writer must include it in the MAP section of the help
project file, using the #include statement. Refer to the Microsoft
Windows Software Development Kit-Tools (SY03146-300-R00-1089) for
information about the Microsoft Windows MAP section of the help project
file.
The following example represents a cross-reference that VFFXLTPC might
generate for the ARB Menu, a FORMSPEC form. In this example, the ARB
Menu has four fields and is the eighth form in the forms file. Note that
prior maintenance activities have moved the fields and deleted some
fields. Previously, this form had nine fields.
#define ARB_MENU 8000
#define ARB_MENU.FNAME 8001
#define ARB_MENU.NOF 8009
#define ARB_MENU.SEL 8007
#define ARB_MENU.FLD 8008
#define ARB_MENU.ENTER.KEY 8900
#define ARB_MENU.FKEY.1 8901
#define ARB_MENU.FKEY.2 8902
#define ARB_MENU.FKEY.3 8903
#define ARB_MENU.FKEY.4 8904
#define ARB_MENU.FKEY.5 8905
#define ARB_MENU.FKEY.6 8906
#define ARB_MENU.FKEY.7 8907
#define ARB_MENU.FKEY.8 8908
#define ARB_MENU.WINDOW.LINE 8999
Relating Forms and Fields to Topics
If you include the cross-reference file in the MAP section of the help
project file, the concatenated form name/field name should correspond to
a topic within the help file. The easiest method of creating this
relationship is to assign the exact name as it appears in the
cross-reference file for the context string of a topic. (Refer to the
Microsoft Windows Software Development Kit-Tools (SY03146-300-R00-1089)
for information about context strings.)
If a specific topic for a form component does not exist, you can use the
Microsoft Windows ALIAS section of the help project file to relate
the form component to another topic. (Refer to the Microsoft
Windows Software Development Kit-Tools (SY03146-300-R00-1089) for
information about the ALIAS section.) For example, one help topic,
NO_HELP_AVAILABLE, could serve as a default topic for all forms or form
components that do not contain help. Alternatively, the form-level help
could server as a default topic for many fields on the form.
The following ALIAS example shows how to indicate that help is
unavailable:
ARB_MENU.SEL=NO_HELP_AVAILABLE ;No help is available
The following ALIAS example shows how to default to form help:
ARB_MENU.SEL=ARB_MENU ;Same help as form
MPE/iX 5.0 Documentation