home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / OS2 / EMXFIX04.ZIP / FLAG.CMD < prev    next >
OS/2 REXX Batch file  |  1994-01-23  |  1KB  |  60 lines

  1. /* flag.cmd */
  2.  
  3. parse arg s1 s2 rest
  4.  
  5. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  6. call SysLoadFuncs
  7.  
  8. select
  9.   when s1 = 'install' then
  10.     do
  11.       if s2 \= '' then
  12.         call usage
  13.       name = stream('flag.dll', 'c', 'query exists')
  14.       if name == '' then
  15.         do
  16.           say '*** flag.dll not in current working directory.'
  17.           exit 2
  18.         end
  19.       call SysRegisterObjectClass 'Flag', name
  20.     end
  21.  
  22.   when s1 = 'uninstall' then
  23.     do
  24.       if s2 \= '' then
  25.         call usage
  26.       if SysDeregisterObjectClass('Flag') then
  27.         say 'Flag class uninstalled successfully.'
  28.       else
  29.         do
  30.           say '*** Uninstallation of Flag class failed.'
  31.           exit 2
  32.         end
  33.     end
  34.  
  35.   when s1 = 'create' then
  36.     do
  37.       if s2 == '' | rest \= '' then
  38.         call usage
  39.       if SysCreateObject('Flag', s2, '<WP_DESKTOP>') then
  40.         say 'Flag object' s2 'created successfully.'
  41.       else
  42.         do
  43.           say '*** Creation of Flag object' s2 'failed.'
  44.           exit 2
  45.         end
  46.     end
  47.  
  48.   otherwise
  49.     call usage
  50. end
  51. exit 0
  52.  
  53. usage:
  54.   say 'Usage:'
  55.   say ''
  56.   say 'flag install                 Install Flag class'
  57.   say 'flag uninstall               Remove Flag class'
  58.   say 'flag create <name>           Create Flag object NAME'
  59.   exit 1
  60.