HP 3000 Manuals

Operation (cont.) [ Micro Focus COBOL System Reference, Volume 2 ] MPE/iX 5.0 Documentation


Micro Focus COBOL System Reference, Volume 2

Operation (cont.) 

PF-Flush-Panel (Value 9) 

Updates the screen with changes to the specified panel that have not yet
been applied because bit 4 or 5 in PPB-Update-Mask was off during
previous calls to Panels.  See the section The Panels Parameter Block for
a description of PPB-Parameter-Block.

Parameters: 

     PPB-Panel-ID                          pic 9(4) comp.
     PPB-Update-Height                       pic 9(4) comp.
     PPB-Update-Width                        pic 9(4) comp.
     PPB-Update-Start-Row            pic 9(4) comp.
     PPB-Update-Start-Col            pic 9(4) comp.
     PPB-Rectangle-Offset            pic 9(4) comp.
     PPB-Update-Count                        pic 9(4) comp.
     PPB-Update-Mask                         pic x.

On Entry: 

PPB-Panel-ID              The identifying handle of the panel to flush.

PPB-Update-Height         The height of the rectangle to update.

PPB-Update-Width          The width of the rectangle to update.

PPB-Update-Start-Row      The first row of the rectangle that is to be
                          updated.

PPB-Update-Start-Col      The first column of the rectangle that is to be
                          updated.

PPB-Rectangle-Offset      The number of characters not to update in the
                          rectangle.

PPB-Update-Count          The number of characters to update in the
                          rectangle.

PPB-Update-Mask           See the section The Panels Parameter Block for
                          a description of PPB-Update-Mask.

On Exit: 

None

Example: 

This example assumes a panel has been defined that is 30 characters wide
and 17 rows deep.  The screen display of the original panel is updated,
starting with the second line, column 1, through the 16th line of the
panel (see Figure 24-3.  The handle of the original panel is assumed to
be saved in data item ws-save-panel-id.

[]
Figure 24-3: Updating Part of a Panel's Display * Define the size of the rectangle to flush move 30 to ppb-update-width move 15 to ppb-update-height * Within the defined rectangle, apply updates beginning with the * first character (relative to 0). move 0 to ppb-rectangle-offset * Now define where in the panel the rectangle starts (0,0) * defines the top left-hand corner of the panel). The update * panel starts on line 2, column 1 of the panel. move 1 to ppb-update-start-row move 0 to ppb-update-start-col * The update rectangle contains 450 characters (15 lines times * 30 characters per line). move 450 to ppb-update-count * Set bits 4 and 5 of the Update Mask on to apply updates for * both text and attributes. Hex 30 is binary 00110000. move X"30" to ppb-update-mask * When the panel was created, it was saved with the panel * identifier in a variable ws-save-panel-id. move ws-save-panel-id to ppb-panel-id *Apply the updates move pf-flush-panel to ppb-function call "PANELS" using panels-parameter-block if ppb-status not = zero * (code to abort) Remarks: PF-Flush-Panel has no effect if you specify a panel that is not enabled. PF-Scroll-Panel (Value 10) Scrolls a rectangular area of a panel. A rectangle is a specific area within a panel. You can scroll this identified area either up or down by row, or left or right by column. You must specify certain data items depending on the bit settings in PPB-Update-Mask: Bit Data Items Needed ------------------------------------------------------- 0 text-buffer, PPB-Buffer-Offset and PPB-Vertical-Stride. 1 attribute-buffer, PPB-Buffer-Offset and PPB-Vertical-Stride. 2 PPB-Fill-Character. 3 PPB-Fill-Attribute. Parameters: PPB-Panel-ID pic 9(4) comp. PPB-Update-Height pic 9(4) comp. PPB-Update-Width pic 9(4) comp. PPB-Update-Start-Row pic 9(4) comp. PPB-Update-Start-Col pic 9(4) comp. PPB-Scroll-Direction pic 9(2) comp. PPB-Scroll-Count pic 9(4) comp. PPB-Update-Mask pic x. PPB-Buffer-Offset pic 9(4) comp. PPB-Vertical-Stride pic 9(4) comp. PPB-Fill-Character pic x. PPB-Fill-Attribute pic x. text-buffer pic x(n). attribute-buffer pic x(n). On Entry: PPB-Panel-ID The identifying handle of the panel to be scrolled. This value is returned from a call to PF-Create-Panel. PPB-Update-Height The height of the rectangle to scroll. PPB-Update-Width The width of the rectangle to scroll. PPB-Update-Start-Row The first row of the rectangle to be affected by the scrolling. PPB-Update-Start-Col The first column of the rectangle to be affected by the scrolling. PPB-Scroll-Direction The direction of the scrolling: 0 - Up 1 - Down 2 - Left 3 - Right PPB-Scroll-Count The number of lines to scroll. PPB-Update-Mask See the section The Panels Parameter Block for a description of PPB-Update-Mask. PPB-Buffer-Offset If bit 0 of PPB-Update-Mask is set, specifies the position of the first character to display from the text-buffer. If bit 1 of PPB-Update-Mask is set, specifies the position of the first attribute to display from attribute-buffer. PPB-Vertical-Stride If bit 0 or 1 of PPB-Update-Mask is set, specifies the length of a line in text-buffer or attribute-buffer. PPB-Fill-Character If bit 2 of PPB-Update-Mask is set, specifies the character that is to be used to fill the rectangle. PPB-Fill-Attribute If bit 3 of PPB-Update-Mask is set, specifies the attribute that is to be used to fill the rectangle. text-buffer If bit 0 of PPB-Update-Mask is set, specifies the text buffer to fill the rectangle from. attribute-buffer If bit 1 of PPB-Update-Mask is set, specifies the attribute buffer to fill the rectangle from. On Exit: None Example: A panel has been defined that is 50 characters wide and 15 rows deep (see Figure 24-4). The handle for this panel is saved in the data item ws-save-panel-id. This example scrolls the text and attributes in the panel up 15 rows and replaces the vacated text with text and attributes from text and attribute buffers. The first 15 lines of the text and attribute buffers are already used (displayed on the screen). Therefore, scrolling starts with the 16th line of the text and attribute buffer (one line in the text and attribute buffers is 50 characters wide).
[]
Figure 24-4: Scrolling Text and Attributes on a Panel * Define an update rectangle; that is a block of the panel to * scroll.In this case, define the entire panel as the rectangle. move 50 to ppb-update-width move 15 to ppb-update-height * Since the update rectangle is the same size as the panel, * begin scrolling with line 1, column 1 of the panel (where 0,0 * is the top left-hand corner of the panel). move 0 to ppb-update-start-row move 0 to ppb-update-start-col * The rectangle scrolls up. move 0 to ppb-scroll-direction * Scroll up 15 lines. move 15 to ppb-scroll-count * The panel is filled with text and attributes from user * specified buffers. The first 15 lines (each line in the buffer * is 50 characters wide) are already displayed. Start updating * with the 16th line of the buffers. PPB-Buffer-Offset specifies * what character of the buffers to begin with (where 1 is the * first character). Therefore, start with the 751st character * (15 rows times 50 characters per row equals 750 characters * already on the screen). move 751 to ppb-buffer-offset * One row of the update rectangle is 50 characters wide. move 50 to ppb-vertical-stride * Update the vacated portions of the panel using text and * attribute buffers (set bits 0 and 1 of PPB-Update-Mask) and * changes are seen on the screen as the rectangle scrolls in * the enabled panel(set bits 4 and 5 of PPB-Update-Mask). * x"33" is binary 00110011. move x"33" to ppb-update-mask * The panel ID was saved in ws-save-panel-id. move ws-save-panel-id to ppb-panel-id * Scroll the panel. The text buffer is text-buffer and the * attribute buffer is attribute-buffer. move pf-scroll-panel to ppb-function call "PANELS" using panels-parameter-block text-buffer attribute-buffer if ppb-status not = zero * (code to abort) Remarks: Panels does not allow you to scroll text and attributes separately. PF-Write-Panel (Value 11) Writes to a panel. Text and attributes you write to the panel are visible on the screen if you use bits 4 and 5 in PPB-Update-Mask and the panel is enabled. You must specify certain data items depending on the bit settings in PPB-Update-Mask: Bit Data Items Needed ------------------------------------------------------- 0 text-buffer, PPB-Buffer-Offset and PPB-Vertical-Stride. 1 attribute-buffer, PPB-Buffer-Offset and PPB-Vertical-Stride. 2 PPB-Fill-Character. 3 PPB-Fill-Attribute. Parameters: PPB-Panel-ID pic 9(4) comp. PPB-Update-Height pic 9(4) comp. PPB-Update-Width pic 9(4) comp. PPB-Update-Start-Row pic 9(4) comp. PPB-Update-Start-Col pic 9(4) comp. PPB-Update-Mask pic x. PPB-Buffer-Offset pic 9(4) comp. PPB-Vertical-Stride pic 9(4) comp. PPB-Fill-Character pic x. PPB-Fill-Attribute pic x. text-buffer pic x(n). attribute-buffer pic x(n). On Entry: PPB-Panel-ID The identifying handle of the panel to write to. PPB-Update-Height The height of the update rectangle. PPB-Update-Width The width of the update rectangle. PPB-Update-Start-Row The first row of the rectangle to be affected by the write. PPB-Update-Start-Col The first column of the rectangle to be affected by the write. PPB-Update-Mask See the section The Panels Parameter Block for a description of PPB-Update-Mask. PPB-Buffer-Offset If bit 0 of PPB-Update-Mask is set, specifies the position of the first character to display from the text-buffer. If bit 1 of PPB-Update-Mask is set, specifies the position of the first attribute to display from attribute-buffer. PPB-Vertical-Stride If bit 0 or 1 of PPB-Update-Mask is set, specifies the length of a line in text-buffer or attribute-buffer. PPB-Fill-Character If bit 2 of PPB-Update-Mask is set, specifies the character that is to be used to fill the rectangle. PPB-Fill-Attribute If bit 3 of PPB-Update-Mask is set, specifies the attribute that is to be used to fill the rectangle. text-buffer If bit 0 of PPB-Update-Mask is set, specifies the text buffer to fill the rectangle from. attribute-buffer If bit 1 of PPB-Update-Mask is set, specifies the attribute buffer to fill the rectangle from. Example: This example assumes a panel has been defined that is 50 characters wide and 15 rows deep (see Figure 24-5). The handle for this panel is saved in the data item ws-save-panel-id. This example writes the first 15 rows from the text and attribute buffers to the panel.
[]
Figure 24-5: Writing Text and Attributes to a Panel * Define an update rectangle (that is a block of the panel to * update). In this case, define the entire panel as the * rectangle. move 50 to ppb-update-width move 15 to ppb-update-height * Since the "update rectangle" is the same size as the panel, * the update window has no offset within the panel. move 0 to ppb-update-start-row move 0 to ppb-update-start-col * Write using text and attribute buffers starting with the first * character of the buffers. move 1 to ppb-buffer-offset * One row of the update window is 50 characters wide. move 50 to ppb-vertical-stride * Start writing beginning with the first character of the update * window (where 0 is the top left-hand corner of the window). move 0 to ppb-rectangle-offset * Write 750 characters (15 rows times 50 characters per row) to * the panel. move 750 to ppb-update-count * Use text and attribute buffers (set bits 0 and 1 of * PPB-Update-Mask) and have the text immediately visible on the * screen if the panel is enabled (set bits 4 and 5 of * PPB-Update-Mask). x"33" is binary 00110011. move x"33" to ppb-update-mask * The panel identifier was saved in ws-save-panel-id. move ws-save-panel-id to ppb-panel-id * Write to the panel. The text buffer is text-buffer and the * attribute buffer is attribute-buffer. move pf-write-panel to ppb-function call "PANELS" using panels-parameter-block ws-text-buffer ws-attribute-buffer if ppb-status not = zero * (code to abort) See Also: PF-Enable-Panel PF-Read-Panel (Value 12) Reads text and attributes from a panel into buffers supplied by your calling program. Parameters: PPB-Panel-ID pic 9(4) comp. PPB-Update-Height pic 9(4) comp. PPB-Update-Width pic 9(4) comp. PPB-Update-Start-Row pic 9(4) comp. PPB-Update-Start-Col pic 9(4) comp. PPB-Rectangle-Offset pic 9(4) comp. PPB-Update-Count pic 9(4) comp. PPB-Buffer-Offset pic 9(4) comp. PPB-Update-Mask pic x. PPB-Vertical-Stride pic 9(4) comp. text-buffer pic x(n). attribute-buffer pic x(n). On Entry: PPB-Panel-ID The identifying handle of the panel to read from. PPB-Update-Height The height of the update rectangle to read from. PPB-Update-Width The width of the update rectangle to read from. PPB-Update-Start-Row The first row of the specified panel to read from. PPB-Update-Start-Col The first column of the specified panel to read from. PPB-Rectangle-Offset The number of characters not to read from the update rectangle. PPB-Update-Count The number of characters to read from the update rectangle. PPB-Buffer-Offset Where the first character read from the update rectangle is placed in the text buffer. PPB-Update-Mask If bit 0 is set, the text read from the panel is to be included in a text buffer. If bit 1 is set, the attributes read from the panel are to be included in an attribute buffer. PPB-Vertical-Stride The width of a line in the text buffer. text-buffer If bit 0 of PPB-Update-Mask is set, specifies the buffer to hold the text read from the panel. attribute-buffer If bit 1 of PPB-Update-Mask is set, specifies the buffer to hold the attributes read from the panel. On Exit: None Example: This example assumes a panel has been defined that is 10 characters wide and 30 rows deep. The handle for this panel is saved in ws-save-panel-id. This example reads a portion of this panel, starting from first column of the 7th line, to the end of the panel. Text only (not attributes) is read into a buffer called text-buffer which is assumed to be defined in the Working-Storage Section of the program. The example panel is shown in Figure 24-6.
[]
Figure 24-6: Reading From a Panel * Define an update rectangle to read from. In this case, define * the rectangle from line 7 through line 30 of the panel. This * is a total of 24 lines and each line is 10 characters wide. move 10 to ppb-update-width move 24 to ppb-update-height * Start reading beginning with the 7th line and first column of * the panel. (0,0 is the top left-hand corner of the panel.) move 6 to ppb-update-start-row move 0 to ppb-update-start col * Within the rectangle, read beginning with the first character * (where 0 is the top left-hand corner of the rectangle). move 0 to ppb-rectangle-offset * Read 240 characters into the buffers (24 lines times 10 * characters per line). move 240 to ppb-update-count * Read updates beginning with the first character of the buffer. move 1 to ppb-buffer-offset * One row of the update rectangle is 10 characters wide. move 10 to ppb-vertical-stride * Read text only, not attributes (set bit 0 of PPB-Update-Mask). move x"01" to ppb-update-mask * The panel identifier was saved in ws-save-panel-id. move ws-save-panel-id to ppb-panel-id * Read text from the panel into text-buffer, defined * as PIC X(240). move pf-read-panel to ppb-function call "PANELS" using panels-parameter-block text-buffer if ppb-status not = zero * (code to abort) Remarks: PF-Read-Panel does not behave like an ACCEPT statement; that is, it does not allow the user to input information to a panel. If you want to obtain information from the user, you must use an ACCEPT statement. You must make sure that the buffers are large enough to accommodate the data that Panels places into them. If they are not large enough, Panels could overwrite information following the buffers in the Working-Storage Section of your program. PF-Get-Panel-At-Position (Value 13) Determines if there is a panel at a particular position. If there is, details of the panel's appearance are also returned. Parameters: PPB-Panel-Start-Column pic 9(4) comp. PPB-Panel-Start-Row pic 9(4) comp. PPB-Panel-ID pic 9(4) comp. PPB-Panel-Height pic 9(4) comp. PPB-Panel-Width pic 9(4) comp. PPB-Visible-Height pic 9(4) comp. PPB-Visible-Width pic 9(4) comp. PPB-Panel-Start-Column pic 9(4) comp. PPB-Panel-Start-Row pic 9(4) comp. PPB-First-Visible-Col pic 9(4) comp. PPB-First-Visible-Row pic 9(4) comp. On Entry: PPB-Panel-Start-Column The x-coordinate to check for the existence of a panel. PPB-Panel-Start-Row The y-coordinate to check for the existence of a panel. On Exit: PPB-Panel-ID The identifying handle of the panel found at the specified location. If there is no enabled panel, a value of 0 is returned. If more than one panel exists at the specified location, the handle of the panel most recently enabled is returned. PPB-Panel-Height The height of the panel found at the specified location. PPB-Panel-Width The width of the panel found at the specified location. PPB-Visible-Height The height of the visible window on the panel. PPB-Visible-Width The width of the visible window on the panel. PPB-Panel-Start-Column The x-coordinate of the left edge of the panel on the screen. The first column on the screen is column 0. PPB-Panel-Start-Row The y-coordinate of the top edge of the panel on the screen. The first first row on the screen is row 0. PPB-First-Visible-Col The x-coordinate of the visible window, relative to the panel. The column of the panel is column 0. PPB-First-Visible-Row The y-coordinate of the visible window, relative to the panel. The first row of the panel is row 0. Example: This example identifies which panel is at line 4, column 6 (where 0,0 is the top left-hand corner of the screen). move 3 to ppb-panel-start-row move 5 to ppb-panel-start-column move pf-get-panel-at-position to ppb-function call "PANELS" using panels-parameter-block if ppb-status not = zero * (code to abort) Remarks: Use PF-Get-Panel-Info if you know the handle of a panel but want to return information about its appearance. See Also: PF-Get-Panel-Info 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 the chapter Adis for information about this module. The example program panelex2supplied with your software shows how Adis can be used with Panels. The Panels Tutorial, pantutor.cbl, also gives examples of using Adis with Panels. Considerations When Using Adis and Panels. 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 could 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. Overview of Adis Functions for Panels. The available Adis functions for use with Panels are: Function Description Number ------------------------------------------------------- 1 Enables or disables Adis indicators or error messages. 49 Initializes Adis for use with Panels. 56 Specifies the panel to which you direct the ACCEPT and DISPLAY statements. 57 Updates the screen with several DISPLAY statements using only one call. 62 Suspends the use of Panels by Adis. 63 Returns the status of Panels' use by Adis. These functions are fully described, in the order of their function numbers, in the section Adis Function Descriptions. CALL Syntax. The syntax for using these Adis functions is: call x"AF" using function-code parameter where: function-code is a PIC X COMP-X field which contains the number of the function to be executed. parameter varies according to the function. See the description of the individual function for information about the setting of parameter.
NOTE * All Adis calls must have a second parameter even though its contents are sometimes ignored. * If an error occurs while executing this call, parameter returns a value of 255.
Adis Function Descriptions. Disable or Enable Adis Indicators. When you use x"AF" 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, Auto-skip, and Off-end-of-field indicators). Another field is used for displaying Adis error messages. You might 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 is PIC X COMP-X VALUE 1. If an error occurs in the execution of this function, function-code is set to 255 on exit. parameter is a PIC X(4) field containing one of the following values: 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-function is PIC X COMP-X VALUE 49. 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 the section Specify Panel for ACCEPT/DISPLAY for information on how to do this. The panel identifier (Panel-ID) value of the panel created by this call is always 0. This call creates 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. * A one-character panel for the off end of field indicator. * A one-character panel for the auto-skip indicator. * A one-character panel for the replace indicator. See the chapter Adis Configuration Utility (Adiscf) for more information about these indicators. These six panels cannot be used by your program. See the section Enable or Disable Adis Indicators for information on enabling or disabling them. Specify Panel for ACCEPT/DISPLAY. This function tells Adis which panel is to be used for all following ACCEPT and DISPLAY statements in your program. All ACCEPT and DISPLAY statements are 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-function work-panel-ID where: specify-panel- is PIC X COMP-X VALUE 56. function work-panel-ID is a PIC XX COMP-X field containing the identifying handle of the panel to be used for the ACCEPT and DISPLAY statements. If you use the panel created by Adis as a result of a call to x"AF" 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. If the specified panel does not exist, the value 255 is returned in specify-panel-function, and the previously specified panel is 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 identifier 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-function control-update-parameter where: ontrol-update-function is PIC X COMP-X VALUE 57. ontrol-update-parameter is a PIC X COMP-X field containing one of the following values: 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-c 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 are not 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 is 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 x"AF" function 49 to initialize Adis to use Panels. See the section Initiliaze Adis to use Panels for details of doing this. The syntax for calling this function is: call x"AF" using suspend-function suspend-parameter where: suspend-function is PIC X COMP-X VALUE 62. suspend-parameter is a PIC X COMP-X field containing one of the following values: 0 - Suspend the use of Panels. 1 - Re-enable the use of Panels. If Adis has not been initialized to work with Panels, the value 255 is returned in suspend-function. 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 Return 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 is PIC X COMP-X VALUE 63. get-status-parameter is a group item with the following definition: usage-flag Defined as PIC X COMP-X, specifying whether Adis has beeninitialized to use Panels. 0 indicates that Adis is not using Panels. status-flag Defined as PIC X COMP-X, specifying whether Panels working is currently enabled on Adis. current-id Defined as PIC XX COMP-X, specifying the handle 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 Panels Error Codes This section lists the values that can be returned in the status field PPB-Status by a call to Panels. The mnemonics are shown in the order in which they appear in panlink.cpy. PE-No-Error (Value 0). The function requested completed successfully. PE-Not-Created (Value 1). The panel required does not exist. This value is returned if you attempt to perform a function on a panel that has not yet been created. You must create a panel before it can be used. PE-Invalid-ID (Value 2). The panel identifier is outside the range of valid panel identifiers. The maximum number of panels that can be visible at one time is 254. PE-Invalid-Parameters (Value 3). The update parameters supplied do not define an area that is inside the panel. The specified values of PPB-Update-Start-Row or PPB-Update-Start-Col are outside the panel; that is,, they are greater than the height and/or width of the panel. PE-Invalid-Function (Value 4). The function number specified in PPB-Function is not a valid function number. PE-No-Room-For-Panel (Value 5). The program is trying to create too many panels. The maximum number of panels have already been created. This error occurs on a call to PF-Create-Panel if the maximum number of panels (65534) has already been created. PE-Panel-Too-Large (Value 6). The panel specified is too large. This value is returned if the program has specified a panel size that is too large. This will be due to one of the following reasons: 1. The program is tryingto create a panel that is toolarge that is: PPB-Panel-Width *PPB-Panel-Height &> 65535. 2. The width of the panel is greater than 2000 characters. 3. There is insufficient memory available to hold thepanel text and attribute buffers. PE-Invalid-Direction (Value 7). The value supplied in PPB-Scroll-Direction is not in the range 0 to 3. PE-Invalid-Scroll-Count (Value 8). You are trying to scroll too many rows or columns. The specified value of PPB-Scroll-Count is greater than the number of rows or columns in the panel (depending on the direction of scroll). PE-Cannot-Initialise (Value 9). Panels cannot initialize. This is a fatal error which occurs only on the first call to Panels made by a program in your system. It means that for some reason, Panels cannot initialize. Packaging a Panels Application This section shows you the files you will need to link in with your program if it uses Panels. If your program uses Panels without Adis, the only file you must link in is panels.obj. If your program makes use of Adis function as well as Panels, you must link in the following: * panels.obj * adis.obj * adisinit.obj * adiskey.obj


MPE/iX 5.0 Documentation