HPlogo HP Data Entry and Forms Management System (VPLUS) Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 6 USING VPLUS INTRINSICS

USING TERMINAL FEATURES

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

VPLUS provides a way to take advantage of special terminal features, using processing specifications (refer to Section 4), VPLUS intrinsics, and selections on the FORMSPEC menus (refer to Section 3). Two of the special terminal features that can be controlled with VPLUS intrinsics are touch and local form storage, as described below. Refer to Appendix G for a list of terminals that support these features.

The Touch Feature

VPLUS supports the touch feature available with specified terminals, as listed in Appendix G. The touch feature is aimed to improve programmer productivity for the design of intuitive, friendly user interfaces.

To activate the touch feature, an application must set bit 0 of the showcontrol word in the comarea to 1 before calling VSHOWFORM. This feature will remain activated until the showcontrol bit 0 is set to 0, or until VCLOSETERM is called.

With the touch enhancement enabled, VREADFIELDS returns a number when a field on the form is touched. This number is the negative of the field number that was assigned by FORMSPEC at form design time. All fields as currently defined on a form return a negative of their assigned field number when touched. No additional definition of touch fields is necessary. The number returned is negative in order to distinguish it from the positive numbers returned for function keys. In this manner, fields on the form can be treated just like function keys.

Thus, touch applications can be designed using the same VPLUS intrinsics and the same forms file. The negative field number returned to the lastkey field in the comarea can then be interpreted for further processing.

Local Form Storage

Certain terminals allow forms to be stored locally in terminal memory, which can reduce the overhead of writing a form image from the form definition area of memory. Frequently displayed forms can be loaded into the terminal to be written directly to the screen. Only form images are loaded — not the associated data. The HP 2626A terminal can store as many as four forms locally. The HP 2624B and HP 2394A terminal can store a maximum of 255 forms locally depending on the size of the forms and the size of terminal memory available.

The VPLUS intrinsics and communication area items activate and control local form storage. The same intrinsics and variables are used with local form storage terminals, but there are some differences as to how the form storage is handled. These differences, along with general information about using form storage, are described here. The specifics of the intrinsics involved are contained in the individual intrinsic descriptions later in this section.

The HP 2626A vs. the HP 2624B/HP 2394A

VPLUS utilizes the workspace/window feature of the HP 2626A terminal, configuring terminal memory into from one to four workspaces to store forms. Total available space is equal to 119 lines of forms, with the minimum size of a workspace being 26 lines. One full-screen window is used to display a form.

A form is displayed by attaching a workspace to the window. Any enhancements and data entered onto the form are part of the form as long as it is in the terminal — a "fresh" form is not available in local storage. If a fresh copy of the form is to be displayed, it must be written from the form definition area of system memory.

One workspace is always attached to the window and displayed, even if there are no forms loaded. The workspace being displayed is frozen — no form can be loaded into this frozen workspace. Therefore, only three forms can actually be loaded in a single call to VLOADFORMS. To get a fourth form into the terminal, display it in the window with VSHOWFORM.

Forms can be purged from the terminal if there is not room for the form you are trying to load. Forms are purged on a "least recently used" basis. During a load operation, each form is frozen until all forms have been loaded, thus preventing loading and purging in a single operation.

If you want to purge the currently displayed form from the terminal, it is not erased from the screen, but the form storage directory entry for this workspace is marked available. (The form storage directory is discussed later in this section.)

On the HP 2624B/HP 2394A terminals, forms stored locally are copied from terminal memory to the screen. A fresh copy of the form remains available in local storage. When the terminal is opened, enough memory is reserved to display the largest form in the forms file and this affects how many forms can actually be loaded.

Form Storage Directory

The comarea variable formstoresize, which must be set before opening the terminal and the forms file, indicates the maximum number of forms you are going to store locally. A form storage directory with an entry for each form is created on the user stack. This directory is used to keep track of loaded forms and of how much terminal memory each form is using. Note that setting this variable does not load any forms — it just reserves space for them. VSHOWFORM searches the directory to determine if a form to be displayed is in local storage.

When a form is purged from local storage, the corresponding directory entry is marked available to indicate that the form is no longer in the terminal and is not taking up any terminal memory space.

NOTE: VCLOSETERM deallocates local form storage space — both VOPENTERM and VOPENFORMF must be called if local form storage space is to be reallocated.

Loading Forms

Forms can be loaded into local form storage in the following ways:

  • Preload the current form when VSHOWFORM is called by setting showcontrol bit 9 to one.

  • Load the next form when VREADFIELDS is called by setting lookahead to zero.

  • Call VLOADFORMS.

When VSHOWFORM is called to display a form, it searches the form storage directory to determine whether or not the form is already in the terminal.

If the form is in local storage, VSHOWFORM displays it on the screen. If the form is not in local storage, VSHOWFORM preloads it into the terminal before displaying it when bit 9 of the comarea variable showcontrol is set to one.

If there is not enough room in terminal memory for the form, the least recently used form (or forms) is purged from the terminal. If the form is not already in the terminal and is not preloaded into local form storage (bit 9 is zero), it is written to the screen from the form definition area of system memory.

(On the HP 2626A terminal, the form is written from memory when showcontrol bit 15 is set to force a write, no matter what the setting of showcontrol bit 9 or whether the form is already in the terminal.)

Look-ahead loading can be performed by setting the comarea variable lookahead to zero before the call to VREADFIELDS. The next form, named by nfname in VGETNEXTFORM, is loaded before or after the current form is read depending on the type of data communications being used. If point-to-point is being used, the next form is loaded before the current form is read, If multipoint is being used, the next form is loaded after the current form is read. The least recently used form (or forms) is purged from the terminal if there is not enough room to load the next form.

VREADFIELDS does not check whether or not the next form loads successfully. If the form does not load, the next call to VSHOWFORM retrieves it from the form definition area of system memory.

Forms can also be loaded into local form storage by a call to VLOADFORMS, which simply loads the forms named in the forms parameter. A form loaded by this intrinsic is thus already in the terminal when the call to VSHOWFORM is made (recall that VSHOWFORM always checks whether the form is in local storage). Forms are loaded in the order specified in the forms parameter as long as there is space in the terminal. Any remaining forms are ignored.

VLOADFORMS checks to see whether or not a form is loaded. During this check, the keyboard is locked briefly. To avoid possible loss of keystrokes and/or entered data do not call VLOADFORMS between VSHOWFORM and VREADFIELDS.

Form Families and Local Storage

VLOADFORMS loads forms strictly by form name so that multiple family members can be loaded at the same time. For look-ahead loading or preloading, to optimize performance, the form is not loaded if a related form is currently being displayed or is already in the terminal. The family member that is in local storage is changed into the required form and displayed by VSHOWFORM (unless showcontrol bit 15 is set to force a fresh copy of the form to be written).

Note that form family optimization displays any data associated with the required form. When optimization occurs on the HP 2626A terminal, the form storage directory is updated to reflect the name of the required form rather than the name of the family member that was used to make the change.

Appending Forms and Local Storage

The implementation of appending forms differs between the HP 2626A and the HP 2624B/HP 2394A terminals. On the HP 2626A, the appending form is always written to the screen from the form definition area of memory rather than being displayed from local storage. If, however, the appending form has 24 or more lines (23 or more if a message window is defined), it is handled as an independent form rather than as an appending one. In this case, it can be displayed from local storage.

The workspace for the current form (the one being appended to) is marked available, so the current form cannot be displayed again from local storage.

Form family optimization occurs when the current form is an appended form and is related to the next form to be displayed. The current appended form is changed into the required form when it is displayed.

On the HP 2624B/HP 2394A terminals, the appending form can be copied from local storage.

Purging Forms From Local Storage

The VUNLOADFORM intrinsic is used to purge an unneeded form from local storage to make room for a new form. This intrinsic checks to see whether or not a form is purged. During this cheek, the keyboard is locked briefly. To avoid possible loss of keystrokes and/or entered data, do not call VUNLOADFORM between VSHOWFORM and VREADFIELDS. In addition, the intrinsics VCLOSEFORMF and VCLOSETERM also clear all forms from local storage.

With look-ahead loading, forms can be automatically purged from the terminal to make room for a new form. To protect forms from being purged from local storage, set lookahead to one before any other calls to VREADFIELDS or to VLOADFORMS. If lookahead is zero, the least recently used forms are purged if necessary. However, when showcontrol bit 9 is set to one, forms can be purged to make room even if look-ahead is not enabled.

Feedback to webmaster