SCREEN MANAGEMENT INTRINSICS [ High-Level Screen Management Intrinsic Library (Hi-Li) Reference Manual ] MPE/iX 5.0 Documentation
High-Level Screen Management Intrinsic Library (Hi-Li) Reference Manual
Chapter 2 SCREEN MANAGEMENT INTRINSICS
This chapter provides comprehensive information about the Hi-Li
intrinsics. If you have never used the screen management facility, read
this chapter before you begin using Hi-Li intrinsics to code your
application.
The topics in this chapter include:
* The basic structure of Hi-Li intrinsics and how they are used
* The way Hi-Li uses the Application-ready Buffer (ARB)
* The languages that Hi-Li supports
* The data types and structures that Hi-Li uses
* The rules for using Hi-Li
Hi-Li Intrinsics
The HP screen management facility comprises three core intrinsics,
HPDSEND, HPDREAD, and HPDPROMPT. They provide the basic functions needed
for the exchange of data between the terminal and your application.
These core intrinsics are supported by the HPDOPENFORMS, HPDCLOSEFORMS,
HPDENABLETERM, and HPDDISABLETERM intrinsics. They perform housekeeping
functions such as opening and closing forms files. The remaining
intrinsics perform more specialized functions that your application may
require, such as configuring parts of the execution environment. Figure
2-1 shows the relationships among the intrinsics.
Figure 2-1. Core and Supporting Intrinsics
Core Intrinsics. These intrinsics provide basic functionality.
HPDSEND Passes application data to the operator's
device and arranges it according to a
scheme identified or provided by the
application.
HPDREAD Collects data from the operator's device
and returns it to the application.
HPDPROMPT Lets the application focus the operator's
attention by altering and highlighting
data when it is displayed at the
terminal.
Supporting Intrinsics. These intrinsics provide supportive and
specialized capabilities.
Supportive Capabilities:
HPDOPENFORMS These intrinsics perform the housekeeping
HPDCLOSEFORMS duties of opening and closing forms, and
HPDENABLETERM enabling and disabling the terminal.
HPDDISENABLETERM
Specialized Capabilities:
HPDGETENV HPDSETENV These intrinsics let you see and set the values
for options in the execution environment. Use
them when your application requires a special
configuration.
HPDPRINTFORM Lets you obtain a printed copy of a form with
its data.
HPDGETDESIGN Lets you retrieve design information to
facilitate documenting your application.
HP32424 Lets you identify the current version of the
Hi-Li software.
The Hi-Li intrinsics and their parameters are described in detail in
Chapter 3.
The Hi-Li Model
Hi-Li is designed to control the transfer of data between the terminal
and an application with an interactive user interface. The data is
transferred as a block, rather than item by item. The sequence is as
follows.
The HPDSEND intrinsic sets up the form and displays it according to
instructions specified in the application. The instructions cover such
things as the initialization of field displays, key label display, and
the display of application messages in the message window.
The HPDREAD intrinsic reads and collects the information that the
operator supplies on the form. If any errors are detected, the HPDPROMPT
intrinsic is called to alert the operator to the error by highlighting
particular fields and/or displaying messages.
The supporting intrinsics enable the core intrinsics to transfer data by
performing the basic housekeeping tasks of enabling the terminal and
opening the forms file, and then disabling the terminal and closing the
forms file when the application is finished.
Figure 2-2. The Hi-Li Model
Hi-Li and the Application-ready Buffer (ARB)
A data buffer is passed by the application to HPDSEND, HPDREAD, and
HPDPRINTFORM. You can specify the instructions for how you want data
moved between this buffer and the form in one of two ways. In the first
way, you code your application to specify how you want the contents of
the data buffer handled by including a 'data description' parameter.
This is the direct method of transferring data, and Hi-Li supports five
such methods.
In the second way, you code your application to specify that you want the
contents of the data buffer handled according to specifications in the
forms file. This is the indirect method, which takes advantage of the
Application-ready Buffer (ARB).
Each of these six methods is discussed in detail in Chapter 4.
The Application-ready Buffer. The purpose of the ARB is to represent
data as the application expects to use it, and not necessarily as it
appears on the screen. For example, a given application may have one
arrangement of fields on the screen that corresponds to data entry needs,
and a different internal arrangement that corresponds to file storage
layout. In addition, some of the screen data, always in character
format, may need to be converted and stored in non-character formats for
subsequent processing. Finally, the application's internal buffer may
contain data fields that are not for display on the operator's terminal,
such as dataset search items (keys) or system checksums.
You can use the ARB to accomplish the data remapping, type conversions,
and masking required by your application, instead of having to write
application code for these purposes. Use the ARB menus in FORMSPEC/V to
specify the necessary data manipulations. Whether or not you choose to
use the ARB method for managing data transfers between your application
and its associated forms depends on the specific requirements of your
application.
For complete information about the Application-ready Buffer, see the HP
Forms Management (VPLUS/V) Reference Manual (Part No. 32209-90001).
Data Types
Table 2-1 shows the data types and structures that are used in Hi-Li
intrinsics.
Table 2-1. Data Types and Structures
-------------------------------------------------------------------------------------------------
| | | | |
| FORMSPEC | COBOL | Pascal | FORTRAN |
| | | | |
-------------------------------------------------------------------------------------------------
| | | | |
| CHAR | X | Packed array | CHAR *_ |
| | | CHAR [.._] | |
| | | | |
| YYDDMM | X(6) | as above | CHAR *6xx |
| | | | |
| ZONEn | 9(_).n | --- | --- |
| | | | |
| PACKn | 9(_)Vn COMP-3 | --- | --- |
| | | | |
| SPACKn | S9(-)Vn COMP-3 | --- | --- |
| | | | |
| REAL | --- | REAL | REAL |
| | | | |
| LONG | --- | LONG | Double |
| | | | Precision |
| | | | |
| INT | S9(4) COMP | Subrange | Integer **2 |
| | | -32768..32767 | |
| | | | |
| DINT | S9(9) COMP | Integer | Integer **4 |
| | | | |
-------------------------------------------------------------------------------------------------
Note: [n] represents the number of decimal digits
How Hi-Li Intrinsic Parameters Operate
The Hi-Li intrinsics act as a link between the application and the forms
created with FORMSPEC/V. Table 2-2 shows how the information flow is
controlled by various parameters as they are passed between Hi-Li and the
application.
Table 2-2. Information Flow
---------------------------------------------------------------------------------------------
| | |
| Data | How it is Processed |
| | |
---------------------------------------------------------------------------------------------
| | |
| Communications | - Set up by the application |
| (GLOBALPAK | - Formatted by open/enable |
| | - Passed between intrinsics |
| | |
---------------------------------------------------------------------------------------------
| | |
| Status | - Passed back from each intrinsic |
| | to the application |
| | |
---------------------------------------------------------------------------------------------
| | |
| Processing Instructions | - Passed to each intrinsic |
| (SENDPAK, READPAK, PROMPTPAK, | by the application |
| DATADESCPT, LABELDESCRPT, | |
| READITEMS, | |
| CURSORPOSITION) | |
| | |
---------------------------------------------------------------------------------------------
| | |
| User Interface Specifications | - Passed to HPDSEND and HPDPROMPT |
| (FORMPAK) | by the application |
| (FIELDLIST for HPDPROMPT) | |
| | |
---------------------------------------------------------------------------------------------
| | |
| User Message | - Passed to HPDSEND and HPDPROMPT |
| (MSG) | by the application |
| | |
---------------------------------------------------------------------------------------------
| | |
| Data | - Passed to HPDSEND by |
| (DATABUF) | the application |
| | |
| | - Passed from HPDREAD to the application |
| | |
---------------------------------------------------------------------------------------------
| | |
| Key Labels | - Passed to HPDSEND and HPDPROMPT |
| (LABELBUF) | by the application |
| | |
---------------------------------------------------------------------------------------------
| | |
| Edit Report | Passed from HPDREAD to |
| (FIELDLIST from HPDREAD) | the application |
| | |
---------------------------------------------------------------------------------------------
Abbreviated Parameters. Each intrinsic has multiple parameters. Certain
parameters can be collapsed so that they pass only one part, or pass a
null value if they are not necessary to your application. This allows
you to build in the feature set you currently need
without having to enter "dummy" information you do not want to include.
If you decide to use additional features at a later time, you can simply
activate and/or expand the necessary parameter; you do not have to add an
additional intrinsic call.
The chnglisttype subparameter of the FORMPAK parameter (HPDSEND
intrinsic) provides an example of how this works. The chnglisttype
parameter allows you to indicate whether you want the HPDSEND intrinsic
to apply change specifications supplied by the application to fields on a
given form. If you assign chnglisttype a value of
zero (to indicate that the change list is empty), the following five
subparameters that detail these change specifications are ignored by
Hi-Li.
For example:
changlisttype = 0
then:
listcount
chngentry
fieldident
chngtype
chngspec
are ignored and never referenced by Hi-Li.
Therefore, the FORMPAK parameter can be abbreviated by specifying a
changlisttype value of zero.
See the HPDSEND intrinsic in Chapter 3 for a complete discussion of the
chnglisttype parameter and its subparameters.
Supported Languages
Hi-Li intrinsics can be used with COBOL, FORTRAN, and Pascal. The call
formats for each of these languages are listed in Table 2-3.
Table 2-3. Language Call Formats
---------------------------------------------------------------------------------------------
| | |
| Language | Intrinsic Call Format |
| | |
---------------------------------------------------------------------------------------------
| | |
| COBOL | CALL "intrinsicname" USING parameter1 |
| | parameter2 |
| | parameter3 |
| | . |
| | . |
| | . |
| | |
| | parametern. |
| | |
---------------------------------------------------------------------------------------------
| | |
| FORTRAN | CALL intrinsicname (parameter1, parameter2,.|.)
| | |
---------------------------------------------------------------------------------------------
| | |
| Pascal | intrinsicname (parameter1, parameter2,...); |
| | |
---------------------------------------------------------------------------------------------
To ensure consistency among calls from different programming languages,
the following rules apply to all parameters:
* Parameters are passed by reference. This means that a literal value
cannot be used as a parameter.
* No condition codes are returned. The status of the call is returned
in a status word included as part of the RETURNPAK parameter.
* Return type intrinsics are not allowed. Any values returned by the
intrinsic are sent as passed parameters.
Hi-Li Dependencies and Rules
The following is a list of rules and dependencies that must be followed
and observed when you use the Hi-Li intrinsics.
1. A forms file must be open before you can print the form.
2. A forms file must be open and your terminal must be enabled before
you can use the HPDSEND, HPDREAD, and HPDPROMPT intrinsics.
3. The HPDGETENV and HPDSETENV intrinsics have guidelines you must
follow that depend on the value you give the MODE parameter. See
the HPDGETENV and HPDSETENV intrinsics in Chapter 3 for
information about these guidelines.
4. The HPDGETDESIGN intrinsic is not compatible with any of the other
Hi-Li intrinsics. This is because the other intrinsics depend on
the form referenced by the HPDSEND intrinsic. This form and the
form referenced by HPDGETDESIGN may be different. Because of
this, you must define a separate GLOBALPAK parameter that you use
only with HPDGETDESIGN; you cannot call this intrinsic using the
GLOBALPAK parameter that you pass to the other intrinsics.
5. You cannot call tHE HPDREAD and HPDPROMPT intrinsics directly
following a call to HPDENABLETERM. This is because Hi-Li expects
to see the HPDSEND intrinsic that sets up the form. To call
HPDREAD or HPDPROMPT in this case, call HPDSEND first.
6. The following read sequences are allowed:
a. A read call following a send and/or a prompt.
b. A read call followed by a second read call with the 'doreread'
option.
7. You cannot call HPDREAD or HPDPROMPT directly follow ing a call to
HPDPRINTFORM. This is because HPDREAD and HPDPROMPT use the form
referenced by the previous HPDSEND intrinsic.
Only one Hi-Li storage area is allocated for form information.
When HPDSEND is called, it sets up this storage area with certain
values. When HPDPRINTFORM is called, it resets these values.
Therefore, to call HPDREAD or HPDPROMPT after making an
HPDPRINTFORM call, call HPDSEND.
8. You cannot mix Hi-Li calls with VPLUS/V calls.
9. A forms file must be opened before you can use the HPDCLOSEFORMS
intrinsic to close it.
10. The terminal must be enabled before you can use the
HPDDDISABLETERM intrinsic to release it.
11. Consecutive forms file opens are not allowed. Always close the
open forms file before opening another.
12. Consecutive terminal enables are not allowed. Always disable the
enabled terminal before enabling a second one.
MPE/iX 5.0 Documentation