home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l360 / 3.ddi / EXPAND.@BL / EXPAND.CBL
Encoding:
Text File  |  1991-04-08  |  1.8 KB  |  42 lines

  1.       $set ans85 mf noosvs
  2.       ************************************************************
  3.       *                                                          *
  4.       *              (C) Micro Focus Ltd. 1989                   *
  5.       *                                                          *
  6.       *                     EXPAND.CBL                           *
  7.       *                                                          *
  8.       *    This program demonstrates a special expanding accept. *
  9.       *    It uses the SIZE IS clause of the SCREEN SECTION to   *
  10.       *    dynamically alter the size of the data item being     *
  11.       *    accepted.                                             *
  12.       *                                                          *
  13.       *    The program repeats the same ACCEPT twenty times      *
  14.       *    each time increasing the size of the data item by 1.  *
  15.       *                                                          *
  16.       ************************************************************
  17.        special-names.
  18.            cursor is cursor-pos.
  19.        working-storage section.
  20.        01 buffer pic x(20).
  21.        01 buf-size pic 99.
  22.        01 cursor-pos.
  23.           02 line-p pic 99.
  24.           02 col-p  pic 99.
  25.        screen section.
  26.        01 screen-1.
  27.          02  value "Expanding accept (" line 1 column 1.
  28.          02  pic x(20) using buffer SIZE IS buf-size line 1 column + 1
  29.               auto.
  30.          02  value ")" line 1 column + 1.
  31.        procedure division.
  32.        main-para.
  33.             display space upon crt.
  34.             move 1 to buf-size, line-p, col-p.
  35.             perform with test after until buf-size = 20
  36.                 display screen-1
  37.                 accept  screen-1
  38.                 add 1 to buf-size, col-p
  39.             end-perform.
  40.             stop run.
  41.  
  42.