home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / db22re.zip / MENU.CMD < prev    next >
OS/2 REXX Batch file  |  1993-03-09  |  3KB  |  89 lines

  1. /*
  2.  ┌──────────────────────────────────────────────────────────────────┐
  3.  │  Name       : curpos.cmd                                         │
  4.  │  Purpose    : experiment with REXXUTILS functions                │
  5.  │  Platform   : DB2/2                                              │
  6.  │  Author     : Jeff Fisher                                        │
  7.  │               IBM Toronto Development Lab                        │
  8.  │  Disclaimer : This "sample" code is for demonstrations only, no  │
  9.  │               warrenties are made or implied as to correct       │
  10.  │               function. You should carefully test this code in   │
  11.  │               your own environment before using it.              │
  12.  │                                                                  │
  13.  └──────────────────────────────────────────────────────────────────┘
  14. */
  15.  
  16. call ProgramInitialize
  17. call MainMenu
  18. call EndProg
  19.  
  20.  
  21. MainMenu:
  22.     call SysCls
  23.     say c.itcyan '******************************************'
  24.     say c.yellow '  Menu experimentor                      '
  25.     say c.yellow '                                         '
  26.     say c.yellow ' _  0  Choice 1                            '
  27.     say c.yellow '    1  Choice 2                            '
  28.     say c.yellow '    2  Choice 3                            '
  29.     say c.yellow '    3  Choice 4                            '
  30.     say c.yellow '    x  Exit                                '
  31.     say c.yellow '                                         '
  32.     say c.itcyan '******************************************' c.white
  33.  
  34.     row = 3
  35.     col = 2
  36.     pos = SysCurPos(row,col)
  37.  
  38.     selection = SysGetKey()
  39.  
  40.     SELECT
  41.         WHEN selection = '0' then call ShowResults
  42.         WHEN selection = '1' then call ShowResults
  43.         WHEN selection = '2' then call ShowResults
  44.         WHEN selection = '3' then call ShowResults
  45.         WHEN selection = 'x' then signal EndProg
  46.         OTHERWISE            NOP
  47.     END
  48.  
  49.     signal MainMenu
  50.  
  51. ShowResults:
  52.     row = 15
  53.     col = 0
  54.     pos = SysCurPos(row,col)
  55.     say 'key pressed is = ' selection
  56.     return
  57.  
  58. ProgramInitialize:
  59.     call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
  60.     call SysLoadFuncs
  61.  
  62.     call SetColor
  63.  
  64.     return
  65.  
  66. EndProg:
  67.     exit
  68.  
  69. SetColor:
  70. /*
  71. */
  72.     ansii.esc      = '1B'x
  73.     c.normal       = ansii.esc || '[0m'
  74.     c.highlite     = ansii.esc || '[1m'
  75.     c.blackback    = ansii.esc || '[40m'
  76.     c.green        = c.normal || ansii.esc || '[32m'
  77.     c.grey         = c.normal || ansii.esc || '[37m'
  78.     c.red          = c.normal || ansii.esc || '[31m'
  79.     c.itred        = c.highlite || ansii.esc || '[31m'
  80.     c.itgreen      = c.highlite || ansii.esc || '[32m'
  81.     c.yellow       = c.highlite || ansii.esc || '[33m'
  82.     c.itblue       = c.highlite || ansii.esc || '[34m'
  83.     c.itmagenta    = c.highlite || ansii.esc || '[35m'
  84.     c.itcyan       = c.highlite || ansii.esc || '[36m'
  85.     c.white        = c.highlite || ansii.esc || '[37m'
  86.     c.std          = c.normal || c.itcyan || c.blackback
  87.     c.reset        = c.normal || c.grey || c.blackback
  88.     return 0
  89.