home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / comm / spot-1.3.lha / Spot / Rexx / UUDecode.spot < prev    next >
Text File  |  1993-12-27  |  1KB  |  52 lines

  1. /* UUDecode.spot written by François Helsen    */
  2. /* Thanks to David Nouls and Alex Van Boxel    */
  3. /*         for their inspiration               */
  4. /* Install as 'UUDecode...' in the ARexx menu. */
  5. /* $VER: UUDecode.spot 1.7 (27.12.93)          */
  6. /* Again modified by David Nouls               */
  7.  
  8. address spot
  9. options results
  10.  
  11. 'ismessages'
  12. if rc = 5 then do
  13.    'requestnotify "Use in message window only!"'
  14.    exit
  15.    end
  16.  
  17. call AddLib('rexxsupport.library',0,-30,0)
  18.  
  19. saveascii 't:spotuu.tmp' overwrite
  20.  
  21. if open(in,'t:spotuu.tmp','r') then do
  22.    if checkcoded(in)=1 then do
  23.       call close(in)
  24.  
  25. /* You may have to change this path into your own path, or make it empty */
  26.  
  27.       'requestpath title "Pick a directory" path "RAM:"'
  28.       if rc = 0 then do
  29.          dirname = result
  30.          olddir = pragma('d', dirname)
  31.          ADDRESS COMMAND 'UUdecode >NIL: t:spotuu.tmp'
  32.          call pragma('d', olddir)
  33.          'requestnotify "File decoded..."'
  34.          end
  35.       end
  36.    else do
  37.       call close(In)
  38.       'requestnotify "This message does not contain UUEncoded Data"'
  39.       end
  40.    call Delete('t:spotuu.tmp')
  41.    end
  42.  
  43. exit /* done here */
  44.  
  45. checkcoded: procedure
  46.    PARSE ARG In
  47.    do while ~eof(in)
  48.    if word(readln(in),1)='begin' then
  49.       return 1
  50.       end
  51.    return 0
  52.