HP 3000 Manuals

Using Panels with ADIS [ COBOL/HP-UX Operating Guide for the Series 700 and 800 ] MPE/iX 5.0 Documentation


COBOL/HP-UX Operating Guide for the Series 700 and 800

Using Panels with ADIS 

The ADIS (ACCEPT/DISPLAY) module in your COBOL software allows you to use
ACCEPT and DISPLAY statements in a program that includes Panels.  (See
Chapter 20 , ADIS for information about this module).  The example
program panelex2 
supplied with your software shows how ADIS can be used with Panels.  The
Panels 
Tutorial (pantutor.cbl 
) also gives examples of using ADIS with Panels.

Some Considerations 

As you use Panels with ADIS, you should be aware of the following points:

   *   Only Enhanced ACCEPT and DISPLAY statements (see your Language 
       Reference) can be directed to a panel.  You may encounter problems
       if you use standard ANSI ACCEPT and DISPLAY 
       statements to write directly to the screen.  The same is true if
       you use the x"B7" 
       COBOL system library routine or the call-by-name screen handling
       routines 
       with Panels.

   *   The positions specified in AT, LINE and COLUMN clauses are 
       relative to the top left corner of the current panel and not to
       the screen.

   *   You can create any number of panels, 
       and can have up to 254 enabled at one time.  Six of these are used
       by ADIS when ADIS is used with Panels.

CALL Syntax 

The syntax for using these ADIS functions is:

call x"AF" using function-code parameter

where:

function-code        PIC X COMP-X

                     contains the number of the function to be executed.

parameter            varies according to the function.

Notes: 

   *   ADIS requires a second parameter for this call even though it may
       ignore its contents.

   *   If an error occurs while executing this call, the parameter
       returns a value of 255.

ADIS Functions for Panels 

The available functions are:

Function Number       Description 

1                     enable or disable ADIS indicators or error messages

49                    create a panel

56                    specify the panel to which you direct the ACCEPT
                      and DISPLAY statments

57                    use only one call to update the screen with several
                      DISPLAY statements

62                    suspend the use of Panels by ADIS

63                    get the status of Panels use by ADIS

Each function is described below with its associated parameter.

Disable or Enable ADIS Indicators 

When you use Function 49 to tell ADIS that you are using ADIS and Panels
together, the function creates six predefined panels for you.  Four of
the panels are used to display ADIS indicators (Insert, Replace,
Autoskip, and Off-end-of-field indicators).  Another field is used for
displaying ADIS error messages.  You may want to suppress these messages
when you are using Panels.

You can disable and enable ADIS error messages and indicators with the
following call:

call x"AF" using function-code parameter 

where:

function-code        PIC X COMP-X VALUE 1.

                     If there is an error, function-code is set to 255 on
                     return from the routine.

parameter            PIC X(4)

                     with a value of:

                     X"01322C01"          to disable the error message
                                          panel.

                     X"03323803"          to disable the indicator
                                          panels.

                     X"01322C02"          to enable the error message
                                          panel.

                     X"03323800"          to enable the indicator panels.

Initialize ADIS to Use Panels 

You use this function to create a panel with the same dimensions as your
screen.  This panel is automatically enabled and is space filled with
white on black attributes.  The screen is cleared.

You execute the following call only once at the beginning of your
program:

call x"AF" using init-panels-function parameter

where:

init-panels-         PIC X COMP-X VALUE 49.
function

parameter            is any alphanumeric data item.  ADIS ignores its
                     size and contents.

Example 

     01 Init-Panels-Function  PIC X COMP-X VALUE 49.
     01 Parameter             PIC X.
           ...
         call x"AF" using Init-Panels-Function
                          Parameter

The panel created by this call is automatically enabled, clearing the
previous contents from the screen.  It contains spaces as the default
backdrop character.  The default attribute setting is white on a black
background.  All ACCEPT and DISPLAY statements are directed to this panel
unless another panel is specified (see Function 56 below).  The panel
identifier (Panel-ID) value of the panel created by this call is always
0.

This call will create six panels for use by ADIS. All but the first of
the following list are on the bottom line of your screen.

   *   a full screen panel

   *   an ADIS error message panel, in columns 1 through 77

   *   a one-character panel for the "insert" indicator (see ADISCF
       Utility)

   *   a one-character panel for the "off end of field" indicator (see
       ADISCF Utility)

   *   a one-character panel for the "auto skip" indicator (see ADISCF
       Utility)

   *   a one-character panel for the "replace" indicator (see ADISCF
       Utility)

These six panels cannot be used by your program.  You can enable or
disable ADIS error messages and/or indicators by using function 1,
described earlier.

Specify Panel for ACCEPT/DISPLAY 

This function tells ADIS which panel will be used for all following
ACCEPT and DISPLAY statements in your program.  All ACCEPT and DISPLAY
statements will be directed to this specified panel until you make
another call to this function.

The syntax for the call is:

     call x"AF" using specify-panel-funct
                      work-panel-ID

where:

specify-panel-funct  PIC X COMP-X VALUE 56.

work-panel-ID        PIC XX COMP-X.

                     is the panel identifier of the panel to be used for
                     the ACCEPT and DISPLAY statements.

                     If you use the panel created by ADIS (Function 49),
                     the panel identifier is 0.

Your program must create a panel before you can execute this call, unless
you want to work with the default panel created by ADIS (Function 49).

If the specified panel does not exist, the value 255 is returned in the
specify-panel-function parameter.  Then the previously specified panel
will be used for the ACCEPT and DISPLAY statements.

If you direct an ACCEPT statement to a panel, the panel is enabled
automatically so that the visible portion is not obscured by another
panel.  If the panels window is smaller than the panel, and the cursor
position resulting from the ACCEPT is not currently visible, ADIS
positions the window so that the text at the cursor becomes visible.  A
DISPLAY statement directed to a panel is the same as the Panels WRITE
function when you update both text and attributes.

Example 

     01 Specify-Panel-Function    PIC X COMP-X VALUE 56.
     01 Work-Panel-ID             PIC XX COMP-X.
          ...
          <Code to create panel and move its ID into Work-Panel-ID>
          ...
           call x"AF" using Specify-Panel-Function Work-Panel-ID

Enable or Disable Delayed Update 

This function allows you to execute several DISPLAY statements without
updating the screen each time one is executed.  You then execute only one
call to update the screen with all of them, often resulting in a faster
updating process.

Screen updates are delayed until either you execute an ACCEPT statement
or you use this call to update the screen and re-enable screen updating
(see below).

The syntax for calling this function is:

     call x"AF" using control-update-funct
                      control-update- param

where:

control-update-      PIC X COMP-X VALUE 57.
funct

control-update-      PIC X COMP-X.
param
                     with a value of:

                     1        to use the delayed update method

                     0        to disable the delayed update method,
                              thereby causing the screen to be
                              immediately updated.

The result of executing an ACCEPT statement is the same as executing this
call with parameter set to 0.  Therefore, after you execute an ACCEPT
statement, you must execute another call to this function with parameter
set to 1 if you still want to use the delayed update method.

Example 

      01 Control-Update-Function     PIC X COMP-X VALUE 57.
      01 Control-Update-Parameter    PIC X COMP-X.
             ...
          move 1 TO Control-Update-Parameter
          call x"AF" using Control-Update-Function
                           Control-Update-Parameter
              ...
     * Any DISPLAY statements here will not be reflected on the screen
              ...
          move 0 TO Control-Update-Parameter
          call x"AF" using Control-Update-Function
                           Control-Update-Parameter
     * Now all the previous displayed information will be visible.

Suspend Use of Panels by ADIS 

This function allows you to suspend the use of Panels by ADIS, in order
to allow direct screen writes where Panels is not required.

You must have previously used the function Initialize ADIS To Use Panels.

The syntax for calling this function is:

     call x"AF" using suspend-function
                      suspend-parameter

where:

suspend-function     PIC X COMP-X VALUE 62.

suspend-parameter    PIC X COMP-X.

                     with a value of:

                     0        suspend use of Panels

                     1        re-enable use of Panels

If ADIS has not been initialized to work with Panels, the value 255 is
returned in the suspend-function parameter.

Example 

      01 Suspend-Function     PIC X COMP-X VALUE 62.
      01 Suspend-Parameter    PIC X COMP-X.
       ...
       Code to set up ADIS to use Panels
              ...
     * Suspend Panels working
          move 0 TO Suspend-Parameter
          call x"AF" using Suspend-Function
                           Suspend-Parameter
              ...
     * Reactivate Panels working
          move 1 TO Suspend-Parameter
          call x"AF" using Suspend-Function Suspend-Parameter

Get Status of Panels Use by ADIS 

This function allows you to obtain details of how ADIS is using Panels
for ACCEPT and DISPLAY statements.

The syntax for calling this function is:

     call x"AF" using get-status-function
                      get-status-parameter

where:

get-status-function  PIC X COMP-X VALUE 63.

get-status-          is a group item containing:
parameter

                     usage-flag          PIC X COMP-X.

                                         defines whether ADIS has been
                                         initialized to use Panels.

                     status-flag         PIC X COMP-X.

                                         defines whether Panels working
                                         is currently enabled on ADIS.

                     current-id          PIC XX COMP-X.

                                         defines the id of the panel
                                         being used by ADIS.

Example 

      01 Get-Status-Function  PIC X COMP-X VALUE 63.
      01 Get-Status-Parameter.
          03 Panels-Usage-Flag     PIC X COMP-X.
          03 Panels-Status-Flag    PIC X COMP-X.
          03 Current-Panel-Id      PIC XX COMP-X.
              ...
          call x"AF" using Get-Status-Function
                           Get-Status-Parameter
          if Panels-Usage-Flag = 0
              display "ADIS is not using Panels."
          else
              if Panels-Status = 0
                  display "Use of Panels by ADIS is suspended."
              else
                  display "Use of Panels by ADIS is active."
                  display "The ID of the PANEL being used by ADIS is"
                          Current-Panel-Id
              end-if
          end-if



MPE/iX 5.0 Documentation