| attribute-buffer | pic x(n) |
| PPB-Buffer-Offset | pic 9(4) comp-x |
| PPB-Panel-ID | pic 9(4) comp-x |
| PPB-Rectangle-Offset | pic 9(4) comp-x |
| PPB-Update-Count | 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) |
| attribute-buffer | PPB-Update-Mask のビット 1 が設定されている場合は、パネルから読み取った属性を保持するバッファーを指定します。 |
| PPB-Buffer-Offset | 更新領域から読み取った最初の文字は、テキスト バッファーに置かれます。 |
| PPB-Panel-ID | 読み取り元となるパネルの識別ハンドル。 |
| PPB-Rectangle-Offset | 更新領域から読み取らない文字数。 |
| PPB-Update-Count | 更新領域から読み取る文字数。 |
| PPB-Update-Height | 読み取り元となる更新領域の高さ。 |
| PPB-Update-Mask | ビット 0 が設定されている場合は、パネルから読み取ったテキストがテキスト バッファーに保存されます。ビット 1 が設定されている場合は、パネルから読み取った属性が属性バッファーに保存されます。 |
| PPB-Update-Start-Col | 読み取り元となる指定パネルの最初の列。 |
| PPB-Update-Start-Row | 読み取り元となる指定パネルの最初の行。 |
| PPB-Update-Width | 読み取り元となる更新領域の幅。 |
| PPB-Vertical-Stride | テキスト バッファーの行幅。 |
| text-buffer | PPB-Update-Mask のビット 0 が設定されている場合は、パネルから読み取ったテキストを保持するバッファーを指定します。 |
この例は、10 文字の幅で 30 行の高さのパネルを仮定しています。パネルのハンドルは、ws-save-panel-id に保存されています。
この例は、7 行目の最初の列からパネルの末尾までの部分を読み取ります。テキストのみ (属性を含まず) が、プログラムの作業場所節に定義されている text-buffer に読み込まれます。
* 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)
説明:
PF-Read-Panel は ACCEPT 文のようには動作しません。つまり、ユーザーはパネルに情報を入力できません。ユーザーからの情報を取得するには、ACCEPT 文を使用する必要があります。
Panels が格納するデータを収容するのに十分なバッファーであることを確認します。バッファーが十分でない場合は、Panels はプログラムの作業場所節にあるバッファーの次の項目にも情報を上書きします。