home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / comm / spot-1.3.lha / Spot / Rexx / SpotCLI.spot < prev    next >
Text File  |  1994-07-18  |  3KB  |  144 lines

  1. /* SpotCLI */
  2.  
  3. address SPOT
  4. options results
  5.  
  6. /* WINDSPEC='con:x-pos/y-pos/x-size/y-size/name/{options}/screen SPOT'
  7.    where {options} consists of any combination of the following:
  8.     /inactive      = will not activate the window once opened
  9.     /nodepth       = no 'to back' gadget
  10.     /nosize        = no change size gadget
  11.     /nodrag        = window cannot be moved
  12.     /noborder      = window has no border
  13.     /close         = add a close gadget (nb: the close gadget will not work)
  14.     /backdrop      = all other windows will appear in front
  15.     /alt x-pos/y-pos/x-size/y-size = alternate size for shrink gadget
  16.  
  17. current setting for DBLPAL hi-res noflicker.  Alter to taste :-)
  18.  
  19. */
  20. windspecs="con:10/100/680/150/SpotCLI/noclose/alt 3/318/100/150/screen SPOT"
  21. if ~show('p','SPOT') then exit
  22.  
  23. call close('STDOUT')
  24. call close('STDIN')
  25.  
  26. if ~show('l','rexxsupport.library') then
  27.   call addlib('rexxsupport.library',0,-30,0)
  28.  
  29. do forever
  30.    if open('STDOUT',windspecs,'w') then do
  31.       call pragma('*','STDOUT')
  32.  
  33.       if open('STDIN','*','r') then
  34.          dummy=0
  35.       else call close('STDOUT')
  36.    end
  37.  
  38.    Say 'PSR Soft'
  39.    Say ''
  40.    hide=0
  41.    lock=0
  42.  
  43.    do until hide=1
  44.       found=0
  45.       call writech('STDOUT','>')
  46.  
  47.       line=readln('STDIN')
  48.       uline=upper(line)
  49.       com=word(uline,1)
  50.  
  51.       if com='AREA' then do
  52.          found=1
  53.          if length(uline)>5 then do
  54.             name=right(uline,length(uline)-5)
  55.             'gotoarea' name
  56.          end
  57.          else do
  58.             'requestarea TITLE "Area" ALL'
  59.             name=result
  60.             if ~(RC=5) then 'gotoarea' name
  61.          end
  62.       end
  63.       if (com='U') | (com='UP') then do
  64.          found=1
  65.          num=word(uline,2)
  66.          if ~datatype(num,'n') then num=1
  67.          if num<1 then num=1
  68.          'isarealist'
  69.          if rc=0 then do c=1 to num
  70.             'prevarea'
  71.          end
  72.          'ismessagelist'
  73.          if rc=0 then do c=1 to num
  74.             'prevmessage'
  75.          end
  76.       end
  77.       if (com='D') | (com='DOWN') then do
  78.          found=1
  79.          num=word(uline,2)
  80.          if ~datatype(num,'n') then num=1
  81.          if num<1 then num=1
  82.          'isarealist'
  83.          if rc=0 then do c=1 to num
  84.             'nextarea'
  85.          end
  86.          'ismessagelist'
  87.          if rc=0 then do c=1 to num
  88.             'nextmessage'
  89.          end
  90.       end
  91.       if (com='LOCKGUI') & (~lock) then do
  92.          found=1
  93.          code=word(uline,2)
  94.          if length(code)<1 then code='CODE'
  95.          say code
  96.          'lockgui'
  97.          say '1b'x || 'c'
  98.          lock=1
  99.       end
  100.       if com='UNLOCKGUI' then do
  101.          found=1
  102.          if code='CODE' then do
  103.             'unlockgui'
  104.             lock=0
  105.          end
  106.          if word(uline,2)=code then do
  107.             'unlockgui'
  108.             lock=0
  109.          end
  110.          if lock then say '  incorrect password'
  111.       end
  112.       if com='CLS' then do
  113.       found=1
  114.       say '1b'x || 'c'
  115.       end
  116.       if com='FREQ' then do
  117.          found=1
  118.          'filerequest'
  119.       end
  120.       if com='QUIT' | com='ENDCLI' | eof('STDIN') then do
  121.          call close('STDOUT')
  122.          call close('STDIN')
  123.          exit
  124.       end
  125.       if com='HIDE' then do
  126.          found=1
  127.          rc=0
  128.          hide=1
  129.          do until rc=5
  130.             call delay(50)
  131.             'ismessages'
  132.          end
  133.       end
  134.       if ~found then do
  135.          "'"line"'"
  136.       end
  137.    end
  138.  
  139.    do until rc=5
  140.       call delay(50)
  141.       'ismessages'
  142.    end
  143. end
  144.