/* UUWrite (written by Francois Helsen/Marc Duponcheel)  */
/* Install as 'UUWrite...' in the ARexx menu.            */
/* $VER: UUEncode.spot 1.03 (28.6.93)                    */

address spot
options results

'isarealist'
if rc = 0 then do
    'requestnotify "Use in message list or from message window!"'
    exit
    end

'requestfile TITLE "File to UUEncode"'

filename = result

if rc ~= 5 then do
    filepart = fp(filename)
    address command
    UUEncode '>T:CodeFile' '"' || filename || '"' '"' || filepart || '"'
    address spot 'write FILE T:CodeFile'
    'Delete >NIL: T:CodeFile'
    end

exit /* done here ... */

/* given a filename, return the filepart */
fp:
 parse arg filename
 return right(filename, length(filename) - max(lastpos("/", filename),lastpos(":", filename)))
