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:

attribute-buffer pic x(n).
PPB-Buffer-Offset pic 9(4) comp-x.
PPB-Fill-Attribute pic x.
PPB-Fill-Character pic x.
PPB-Panel-ID pic 9(4) comp-x.
PPB-Update-Height pic 9(4) comp-x.
PPB-Update-Mask pic x.
PPB-Update-Start-Col pic 9(4) comp-x.
PPB-Update-Start-Row pic 9(4) comp-x.
PPB-Update-Width pic 9(4) comp-x.
PPB-Vertical-Stride pic 9(4) comp-x
text-buffer pic x(n).

On Entry:

attribute-buffer If bit 1 of PPB-Update-Mask is set, specifies the attribute buffer to fill the rectangle from.
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-Fill-Attribute If bit 3 of PPB-Update-Mask is set, specifies the attribute that is to be used to fill the rectangle.
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-Panel-ID The identifying handle of the panel to write to.
PPB-Update-Height The height of the update rectangle.
PPB-Update-Mask See the section Panels Parameter Block.
PPB-Update-Start-Col The first column of the rectangle to be affected by the write.
PPB-Update-Start-Row The first row of the rectangle to be affected by the write.
PPB-Update-Width The width of the update rectangle.
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.
text-buffer If bit 0 of PPB-Update-Mask is set, specifies the text buffer to fill the rectangle from.

Example:

This example assumes a panel has been defined that is 50 characters wide and 15 rows deep. 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.

* 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)