...

 

 SCREEN SECTION.

 

 ...

 

 05  gd3 grid

     paged

     line 9.0 col 33

     size 51 

     lines 7

     column-headings

     row-headings

     centered-headings

     heading-menu-popup 1

     heading-color 257

     data-columns (1, 3)

     display-columns(1, 7)

     alignment ( "C", "L")

     protection 1

     virtual-width 49

     row-cursor-background-color rgb x#C8FFFF

     divider-color 8

     event PAGED-GRID-EVENT

     .

 

 ...

 

 PROCEDURE DIVISION.

 

 ...

 

     modify gd3(1, 1) cell-data "Num"

     modify gd3(1, 2) cell-data "Description"

 

     perform GD3-FIRST-PAGE-PAGED

 

 

 PAGED-GRID-EVENT.

     evaluate event-type

     when msg-paged-first

          move 0 to pagedIdx

     when msg-paged-last

          move 21 to pagedIdx

     when msg-paged-prevpage

     when msg-paged-nextpage

          continue

     when msg-paged-prev

          perform event-data-2 times

             subtract 1 from pagedIdx

             if pagedIdx < 1

                set event-action to event-action-fail

                exit perform

             end-if

          end-perform

          if event-action not = event-action-fail

             modify gd3 insertion-index 2

             modify gd3 record-to-add rec-paged(pagedIdx)

          end-if

     when msg-paged-next

          perform event-data-2 times

             add 1 to pagedIdx

             if pagedIdx > max-paged-element

                set event-action to event-action-fail

                exit perform

             end-if

          end-perform

          if event-action not = event-action-fail

             modify gd3 record-to-add rec-paged(pagedIdx)

          end-if

     end-evaluate

     .

 

 GD3-FIRST-PAGE-PAGED.

     move 6 to pagedIdx

     modify gd3 mass-update 1

     perform varying i from 1 by 1 until i > pagedIdx

        modify gd3 record-to-add rec-paged(i)

     end-perform

     modify gd3 mass-update 0

     .