home *** CD-ROM | disk | FTP | other *** search
/ The AGA Experience 2 / agavol2.iso / rexx / addarc.ro < prev    next >
Text File  |  1995-05-12  |  1KB  |  84 lines

  1. /* 
  2.  
  3.    $VER: AddArc.RO 0.3
  4.  
  5.    Author:
  6.     Oliver Rummeyer (oliver.rummeyer@student.uni-ulm.de)
  7.  
  8.    Function:
  9.     Archives all selected files via Stefan Boberg's LhA. Using this
  10.     script is much faster than using the standard built-in function
  11.     because LhA isn't started for every file. Another advantage is
  12.     that it shows the progress output on screen.
  13.  
  14.    Requires:
  15.     RO 0.90 or newer and LhA command in the AmigaDOS search path
  16.  
  17.    Example:
  18.     BUTTON 8 COMMAND "Arc" "Rx >NIL: REXX:AddArc.RO %a"
  19.  
  20. */
  21.  
  22. PARSE ARG PortName
  23.  
  24. IF PortName="" THEN
  25.  PortName='RO.1'
  26. ELSE
  27.  PortName=STRIP(PortName)
  28.  
  29. ADDRESS VALUE PortName
  30. OPTIONS RESULTS
  31.  
  32. ArcCommand='LhA -x -r a'
  33. Files=''
  34.  
  35. 'Sleep'
  36.  
  37. 'Path Active'
  38. IF RESULT="RESULT" THEN
  39.  DO
  40.   'Wakeup'
  41.   EXIT 5
  42.  END
  43. SourceDir=RESULT
  44.  
  45. 'NumEntries Active Entries'
  46. Num=RESULT
  47. IF Num~=0 THEN
  48.  DO
  49.  
  50.   'StringReq ""'
  51.   IF RESULT="RESULT" THEN
  52.   DO
  53.    'Wakeup'
  54.    EXIT 5
  55.   END
  56.   Name=RESULT
  57.  
  58.   DO Index=1 TO Num
  59.    'GetEntry Active Entries'
  60.    FileName=RESULT
  61.  
  62.    Position=LASTPOS("/",FileName)
  63.    IF Position=0 THEN
  64.     Position=LASTPOS(":",FileName)
  65.    NewName=SUBSTR(FileName,Position+1)
  66.    Files=Files||'*"'||NewName||'*"'||' '
  67.  
  68.    IF LENGTH(Files) > 180 | Index = Num THEN
  69.     DO
  70.      'Message "Adding entries to archive..."'
  71.      'Command "'||ArcCommand||' *"'||Name||'*" '||Files||' &c" ""'
  72.      IF RC ~= 0 THEN
  73.       DO
  74.        'Wakeup'
  75.        EXIT 5
  76.       END
  77.      Files=''
  78.     END
  79.   END
  80.  
  81. END
  82.  
  83. 'Wakeup'
  84.