home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / rexx / dicehelp.raz < prev    next >
Encoding:
Text File  |  1995-02-11  |  1.4 KB  |  60 lines

  1. /*
  2. **      $Id: DICEHelp.raz,v 1.4 1994/10/05 14:28:30 DBernard Rel $
  3. **
  4. **      DICEHelp link script for AZur editor (©1994 J.M. Forgeas).
  5. **
  6. **      Rexx script modeled after versions by David Joiner and Bryce Nesbitt
  7. */
  8.  
  9. OPTIONS RESULTS
  10.  
  11. GetLine
  12. searchline = RESULT
  13. if length(searchline)=0 then exit
  14. GetPos
  15. searchcol = word(RESULT, 2)
  16.  
  17. hostname = address()            /* Source AZur window */
  18. portname = 'DICEHELP'           /* DICEHelp's port name */
  19. tempname = 't:DICEHelp.temp'    /* Temporary file for passing clips */
  20.  
  21. if ~show('p',portname) then do
  22.     address COMMAND 'RUN >NIL: <NIL: DCC:Bin/DICEHelp REXXSTARTUP'
  23.  
  24.     do i = 1 to 6
  25.         if ~show('p',portname) then do
  26.             address COMMAND 'wait 1'
  27.         end
  28.     end
  29.  
  30.     if ~show('p',portname) then do
  31.         'REQMULTI' "DICEHelp program not found !"
  32.         exit
  33.     end
  34. end
  35.  
  36. address value portname
  37. 'Z' searchcol searchline
  38. if RC=0 then do
  39.     refline   = RESULT
  40.         refstring = SUBWORD( refline, 2 )
  41.  
  42.     address value hostname           /* Back to AZur */
  43.     if WORD( refline, 1 ) = "E" then do
  44.         'REQMULTI' "TEXT" refstring
  45.         exit
  46.     end
  47.  
  48.     File2NewWin NAME refstring RO
  49.     if RC > 0 then do       /* if not there, then error       */
  50.         'REQMULTI' "TEXT Error opening" refstring
  51.         exit
  52.     end
  53.  
  54.     exit
  55. end
  56. else do
  57.     address value hostname
  58.     'REQMULTI' "TEXT Error code" RC "DICEHelp failed!"
  59. end
  60.