Previous Topic: Programs That Copy a Screen Image to a Data SetNext Topic: Explanation of SCREEN1 Program


Copy the Screen Data into an Array

Program SCREEN1, shown below, copies the screen data into an array. This program assumes that the session T2 is active.

              OPTION      FLOW,OFF 
              OPTION      TERM,ON 
              OPTION      MAXI,9999 
              SET         A1,1 
              SET         A2,1 
              UDEFINE     LINECT,3 
              SET         LINECT,&SCRNROWS 
              UDEFINE     DATA(50),80 
* 
ULOOP         SET         DATA(&A1),&SCREEN(&A2,80)
              ADD         A1,1 
              ADD         A2,80 
              COMPARE     A1,&SCRNROWS 
              BRANCH      LE,ULOOP 
              ACLPGM      T2,SCREEN2 
              STOP