home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 3 / Meeting_Pearls_III.iso / SYS / Rexx / openopuswindow.rexx < prev    next >
OS/2 REXX Batch file  |  1995-08-21  |  990b  |  55 lines

  1. /* Opens a window in DirOpus 5 */
  2.  
  3. parse arg path ":" app
  4.  
  5. ports=show('P')
  6. found=index(ports,'DOPUS.')
  7.  
  8. if found=0 then do
  9.     if exists("DOpus5:DirectoryOpus") then do
  10.         address command "DOpus5:DirectoryOpus"
  11.         do i=1 until found~=0 | i=15
  12.             ports=show('P')
  13.             found=index(ports,'DOPUS.')
  14.             if found=0 then
  15.                 address command "Wait 1 SECS"
  16.         end
  17.     end
  18. end
  19.  
  20. if found>0 then do
  21.     found2=index(ports,' ',found)
  22.     if found2>0 then
  23.         portname=substr(ports,found,found2-found)
  24.     else
  25.         portname=substr(ports,found)
  26. end
  27. else do
  28.     address command
  29.     ":C/MetaTool :Index/bricks/error-nodiropus TEXT"
  30.     exit 10
  31. end
  32.  
  33. if path=="-" then do
  34.     if open(fh,":Index/infos/"||app||".path","r") then do
  35.         path=readch(fh,256)
  36.         path=left(path,length(path)-1)
  37.         call close(fh)
  38.     end
  39.     else do
  40.         address command
  41.         ":C/MetaTool :Index/bricks/error-internal TEXT"
  42.         exit 10
  43.     end
  44. end
  45.  
  46.  
  47. address value portname
  48. options results
  49. lister new "Meeting_Pearls_III:"||path
  50. handle=result
  51. /*lister set handle icons*/
  52. dopus front
  53.  
  54. exit 0
  55.