HP 3000 Manuals

VTURNOFF and VTURNON Intrinsics [ HP Data Entry and Forms Mgmt. Sys. (VPLUS) Technical Addendum ] MPE/iX 5.0 Documentation


HP Data Entry and Forms Mgmt. Sys. (VPLUS) Technical Addendum

VTURNOFF and VTURNON Intrinsics 

The recommended practice for programming VPLUS applications is to use
only VPLUS intrinsics to perform terminal input/output operations.
Occasionally, however, a VPLUS application must interact with the
terminal without using a form.  The following sections explain the
rationale for using these intrinsics and provide usage information and
examples.

Rationale for Usage 

In order to use methods of terminal input/output other than VPLUS, the
application must switch out of VPLUS mode.  This could be accomplished by
calling VCLOSETERM, then calling VOPENTERM to return to VPLUS mode.
These intrinsics, however, can have undesirable effects if the terminal
input/output mode switch is only temporary.  For example, this intrinsic
pair can:

 *  Logically close the terminal.

 *  Clear the screen image.

 *  Clear and reset the terminal cache if the terminal local forms
    storage is being used.

VTURNOFF and VTURNON provide a more satisfactory solution, because they
support temporary application switches from VPLUS block mode to character
mode and back again.  Consider using VTURNOFF and VTURNON when the
application must:

 *  Switch to a command-level interaction.

 *  Send data to a slave printer.

 *  Display bulk data from a file retrieval.

 *  Write an addendum below the existing form.

Using VTURNOFF and VTURNON in Applications 

The normal terminal input/output loop in VPLUS is a call to VSHOWFORM
followed by a call to VREADFIELDS. Besides presenting data, VSHOWFORM
also prepares the terminal for the companion VREADFIELDS. The recommended
placement of the VTURNOFF/VTURNON pair is prior to calling VSHOWFORM.

If your terminal input/output inside the VTURNOFF/VTURNON pair clears the
screen, you must always follow VTURNON with VSHOWFORM to restore the
previous form or present the next form.  (For the previous form, you need
to set SHOWCONTROL bits (13:3) because VPLUS does not know that you are
clearing the screen.)  If you are not clearing the screen, a reshow is
still appropriate (without the SHOWCONTROL bits).  VPLUS optimizes
VSHOWFORM and only does what is needed.

It is not recommended to restore the screen using VGETNEXTFORM with
nfname in the VPLUS COMAREA set to $REFRESH. This feature is intended to
physically recover a terminal and synchronize the terminal and the
terminal driver.  You would use $REFRESH if the terminal experiences a
power failure or hard reset.  The $REFRESH process is much longer than
simply using VSHOWFORM to restore the previous display.  Additionally,
$REFRESH invokes many of the VOPENTERM functions that VTURNON avoids,
such as the clearing of the local forms storage cache area.

Figures 2-1 through 2-4 show various usages of VTURNOFF and VTURNON.
___________________________________________________________________________
|                                                                         |
|     ...                                                                 |
|       VSHOWFORM                                                         |
|           |                                                             |
|       VREADFIELDS                                                       |
|           |                                                             |
|         The user selects the command mode function key.                 |
|           |                                                             |
|       VTURNOFF                                                          |
|           |                                                             |
|         This is your own terminal I/O, including clearing the screen.   |
|           |                                                             |
|       VTURNON                                                           |
|           |                                                             |
|       VSHOWFORM  This is the same form with SHOWCONTROL bits (13:3) set.|
|     ...                                                                 |
|                                                                         |
___________________________________________________________________________

          Figure 2-1.  Switching to a Command-Level Interaction   
_________________________________________________________________________
|                                                                       |
|     ...                                                               |
|       VSHOWFORM                                                       |
|           |                                                           |
|       VREADFIELDS                                                     |
|           |                                                           |
|         The user selects the print function key for the slave printer.|
|           |                                                           |
|       VTURNOFF                                                        |
|           |                                                           |
|         This is your own terminal I/O through to the printer.         |
|           |                                                           |
|       VTURNON                                                         |
|           |                                                           |
|       VSHOWFORM  This is the same form without SHOWCONTROL bits.      |
|     ...                                                               |
|                                                                       |
_________________________________________________________________________

          Figure 2-2.  Sending Data to a Slave Printer 
__________________________________________________________________________________
|                                                                                |
|     ...                                                                        |
|       VSHOWFORM                                                                |
|           |                                                                    |
|       VREADFIELDS                                                              |
|           |                                                                    |
|         The user selects a key value for retrieving a bulk file.               |
|           |                                                                    |
|       VTURNOFF                                                                 |
|           |                                                                    |
|         This is your own terminal I/O, writing below the existing form,        |
|           reading 'continue' responses until done.                             |
|           |                                                                    |
|       VTURNON                                                                  |
|           |                                                                    |
|       VSHOWFORM  This is the same form, with or without SHOWCONTROL bits,      |
|                        depending on whether the original form was maintained by|
|                        a memory lock.                                          |
|     ...                                                                        |
|                                                                                |
__________________________________________________________________________________

          Figure 2-3.  Displaying Bulk Data from a File Retrieval 
__________________________________________________________________________
|                                                                        |
|     ...                                                                |
|       VSHOWFORM  Set SHOWCONTROL bit 10 to keep the keyboard locked.   |
|           |                                                            |
|       VTURNOFF                                                         |
|           |                                                            |
|         This is your own terminal I/O, writing an addendum below the   |
|           existing form.                                               |
|           |                                                            |
|       VTURNON                                                          |
|           |                                                            |
|       VSHOWFORM  This is the same form without SHOWCONTROL bits 10, 13,|
|                        14, and 15.                                     |
|           |                                                            |
|       VREADFIELDS                                                      |
|     ...                                                                |
__________________________________________________________________________

          Figure 2-4.  Writing an Addendum Below the Existing Form 



MPE/iX 5.0 Documentation