How to Modify Advantage CA-COBOL/XE Paint Panels

Document ID : KB000055785
Last Modified Date : 14/02/2018
Show Technical Document Details

This is the third of a series of articles that will explain how to build, modify, display and accept 3270-formatted screen images in Advantage CA-COBOL/XE.

This article will discuss how to copy, move and delete a single field or a group of fields in a PAINT panel.

Sample 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      ''''''''''                                          
               @@@@@@@@@@                                          
               @@@@@@@@@@                                          
               @@@@@@@@@@                                          
               @@@@@@@@@@

Moving or Copying Fields

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:

  • Tag the fields that you want to move or copy with a field mark character. Place the field mark character at the beginning and end of the field string. If you do not have a field mark key on your keyboard, then use the character that is specified on the DEFINE screen for that panel under ?Special Char Assignments." In our case, the field mark character is represented by a semicolon (;).
                  C'U'S'T'O'M'E'R'''I'N'F'O'R'M'A'T'I'O'N     
                                                              
                                                              
;COMPANY'NAME: '''''''''''''''''''''''''''''''''''''''''''';  
                                                              
 SITE'ID:      ''''''''                                       
                                                              
 PRODUCTS      ''''''''''                                     
               @@@@@@@@@@                                     
               @@@@@@@@@@                                     
               @@@@@@@@@@                                     
               @@@@@@@@@@
  • Then place the cursor to where you want the moved field to be located. In our example, we will place the literal and variable on line 14 (which is two lines below the last item of the array).
  • Press PF12 to move the fields. The field will be moved to the new location, as shown below:
                   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

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:

  • Tag the fields that you want to delete with the field mark character.
  • Press PF12 to delete the fields. The fields will be deleted.

Block Operation Feature

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:

  • Tag the fields that you want to copy with a field mark character. It may be helpful to think of the two field marks as blocking out a rectangle on a panel. The first field mark marks the upper left corner of the rectangle; the second field mark marks the lower right corner of the rectangle. The copy function will be performed on every field that falls within this rectangle. Fields which are partially within the rectangle will not be affected by the block operation. The following shows the placement of the field marks:
                  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.)

  • Place the cursor to the location you want to move the fields. In our example, we are going to place them on line 14 (which is two lines below the last item of the array).
  • Press PF12 to move the fields. The fields will be moved to the new location.
                   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!

Read More About It

To learn more about painting a panel and assigning field attributes using the PAINT facility, refer to the CA-COBOL/XE PAINT Reference Manual and the CA-COBOL/XE Language Reference Manual.

Contribute Your Ideas

If you have a technique that you would like to share with the Advantage COBOL/XE community as a published article, please contact Advantage CA-COBOL/XE Technical Support.