home *** CD-ROM | disk | FTP | other *** search
- $set ans85 noosvs mf
- ************************************************************
- * *
- * (C) Micro Focus Ltd. 1989 *
- * *
- * POPUP.CBL *
- * *
- * *
- * This program illustrates how to simulate POPUP MENUS *
- * *
- * Internal calls used by this program: *
- * *
- * x"af" - Used to detect the use of cursor *
- * keys. *
- * *
- * x"e5" - Used to sound the audible alarm. *
- * *
- * CBL_READ_SCR_CHATTRS - Used to read the characters and *
- * attributes on the screen. *
- * *
- * CBL_WRITE_SCR_CHATTRS- Used to write the characters and *
- * attributes on the screen. *
- * *
- * CBL_WRITE_SCR_ATTRS - Used to set the characters *
- * on the screen. *
- * *
- * CBL_SET_CSR_POS - Used to turn the cursor off. *
- * *
- * *
- ************************************************************
-
- working-storage section.
- 01 screen-position.
- 05 screen-row pic 9(2) comp-x value 05.
- 05 screen-col pic 9(2) comp-x value 15.
- 01 string-length pic 9(4) comp-x value 15.
-
- 01 top-row pic 9(2) comp-x value 05.
- 01 bottom-row pic 9(2) comp-x value 14.
-
- 01 reverse-vid pic x(15) value all x"70".
- 01 black-and-white pic x(15) value all x"07".
-
- 01 screen-origin pic 9(4) comp-x value 0.
- 01 screen-buffer pic x(2000).
- 01 screen-attrs pic x(2000).
- 01 screen-string-length pic 9(4) comp-x value 2000.
-
- 01 get-single-char pic 9(2) comp-x value 26.
- 01 key-status.
- 05 key-type pic x.
- 05 key-code-1 pic 9(2) comp-x.
- 05 key-code-2 pic 9(2) comp-x.
-
- 01 set-bit-pairs pic 9(2) comp-x value 1.
- 01 user-key-control.
- 05 user-key-setting pic 9(2) comp-x value 1.
- 05 filler pic x value "1".
- 05 first-user-key pic 9(2) comp-x value 1.
- 05 number-of-keys pic 9(2) comp-x value 4.
-
- 78 user-fn-key value "1".
- 78 adis-fn-key value "2".
-
- 78 f1-key value 1.
- 78 f2-key value 2.
- 78 f3-key value 3.
- 78 f4-key value 4.
-
- 78 carriage-return value 0.
- 78 up-arrow value 5.
- 78 down-arrow value 6.
-
- 01 cursor-off-screen.
- 05 row-number pic 99 comp-x value 255.
- 05 col-number pic 99 comp-x value 255.
-
-
- screen section.
- 01 g-picscrn.
- 05 blank screen.
- 05 line 6 col 16 value "Option one".
- 05 line 9 col 16 value "Option two".
- 05 line 12 col 16 value "Option three".
- 05 line 15 col 16 value "Option four".
- 05 line 21 col 10 value "F1=Help F2=Window1 F3=Window2
- -" F4=Clear windows".
- 05 line 22 col 10 value "Use