This is the third of a series of articles that will explain how to build, modify, display and accept 3270-formatted screen images in COBOL/XE.
This article will discuss how to copy, move and delete a single field or a group of fields in a PAINT panel.
Here is a sample panel called ARRAYPNL:
C'U'S'T'O'M'E'R'''I'N'F'O'R'M'A'T'I'O'N COMPANY'NAME: '''''''''''''''''''''''''''''''''''''''''''' SITE'ID: '''''''' PRODUCTS '''''''''' @@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@
Let's move both the literal 'COMPANY NAME' and the variable COMPANY-NAME from line 4 to line 14. To initiate the move, perform the following steps:
C'U'S'T'O'M'E'R'''I'N'F'O'R'M'A'T'I'O'N ;COMPANY'NAME: ''''''''''''''''''''''''''''''''''''''''''''; SITE'ID: '''''''' PRODUCTS '''''''''' @@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@
C'U'S'T'O'M'E'R'''I'N'F'O'R'M'A'T'I'O'N SITE'ID: '''''''' PRODUCTS '''''''''' @@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@ COMPANY'NAME: ''''''''''''''''''''''''''''''''''''''''''''
The same steps are performed when you want to copy a field. Instead of pressing the PF12 key, press the PF10 key. In our example, the PF10 key would produce the following:
C'U'S'T'O'M'E'R'''I'N'F'O'R'M'A'T'I'O'N COMPANY'NAME: '''''''''''''''''''''''''''''''''''''''''''' SITE'ID: '''''''' PRODUCTS '''''''''' @@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@ COMPANY'NAME: ''''''''''''''''''''''''''''''''''''''''''''
Deleting fields works the same way as the move/copy; the only difference is that the cursor does not need to be at a specific location. It can be anywhere on the PAINT panel. To initiate the delete, perform the following steps:
PAINT is not limited to copying, moving or deleting on a single line. You can also perform these functions on multiple lines of one PAINT panel. All of the functions that we mentioned before work the same, except for the location of the field marks. In our example, we are going to move a group of fields to the bottom of the PAINT panel. To initiate the block copy, perform the following steps:
C'U'S'T'O'M'E'R'''I'N'F'O'R'M'A'T'I'O'N ;COMPANY'NAME: '''''''''''''''''''''''''''''''''''''''''''' SITE'ID: '''''''' ; PRODUCTS '''''''''' @@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@
(In the above example, we are going to move all fields starting with the literal COMPANY NAME and above the literal PRODUCTS.)
C'U'S'T'O'M'E'R'''I'N'F'O'R'M'A'T'I'O'N PRODUCTS '''''''''' @@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@ COMPANY'NAME: '''''''''''''''''''''''''''''''''''''''''''' SITE'ID: ''''''''
It's just that simple!
To learn more about painting a panel and assigning field attributes using the PAINT facility, refer to the COBOL/XE PAINT Reference Manual and the COBOL/XE Language Reference Manual.
If you have a technique that you would like to share with the COBOL/XE community as a published article, please contact COBOL/XE Technical Support.