home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 480.lha / BuildScreen_v2.0 / test2.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1991-02-06  |  2.0 KB  |  55 lines

  1. /* */
  2. options results
  3. here  = pragma('D','ram:')
  4. there = pragma('D',here)
  5. address command 'cd '|| here||'0a'x||'stack 20000'||'0a'x|| 'c:run >nil: tbuildscreen ex2 nil:'
  6.  
  7. address command 'waitforport xxxport'||'0a'x|| 'waitforport xxxport'
  8. address command 'waitforport xxxport'||'0a'x|| 'waitforport xxxport'
  9.  
  10. do forever
  11.         address 'xxxport' 'RWAIT'             /* wait for user to do something */
  12.         a = RESULT
  13.         parse var a action p2 p3 p4 p5 p6 .   /* parse response from buildscreen */
  14.  
  15. /*      say 'here is the result "'|| a ||'"'  */
  16.  
  17.         if action = "" then do                /* this is a menu null (rmb down no select ) */
  18.                 address 'xxxport' 'fillbox wname 199 190 10 7 2 3'
  19.                 say 'menu null'
  20.         end
  21.         if action = "C" then do               /* close box hit */
  22.                 say 'window closed'
  23.                 leave
  24.         end
  25.         if action = "G" then do               /* gadget hit */
  26.                 gid = p3
  27.                 /*  say 'gadget ID ' gid ' type is ' p2  */
  28.                 if p2 = 'P' then do
  29.                    p5 = ((p5*10) /65535) % 1
  30.                    nnn = '' || p5
  31.                    mmm = copies(' ',6-length(nnn))
  32.                    qqq = mmm||p5
  33.                    dial = 'textat wname 150 190 "' || qqq || '" 1 0 jam2'
  34.                    address 'xxxport' dial
  35.                    say 'gad val = ' qqq
  36.                 end
  37.                 if p2 = "I" then do
  38.                         say 'integer select ' p4 ' for gadget ' gid
  39.                 end
  40.                 if p2 = "S" then do
  41.                         n = pos("=",a) +1
  42.                         say 'string select |' || substr(a,n) ||  "|" ' for gad ' gid
  43.                 end
  44.                 if p2 = "B" then do
  45.                         say 'button pressed' p3
  46.  
  47.                 end
  48.         end
  49.         if action = "M" then do               /* menu op */
  50.  
  51.                 say 'Menu checked=' p2 ' menu# ' p3  ' item ' p4 ' sub item ' p5
  52.         end
  53.  
  54. end
  55.