home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / FileMover / Dopus5 / DC-OP55B.LZX / Opus5 / arexx / Compare.dopus5 < prev    next >
Encoding:
Text File  |  1996-06-13  |  3.1 KB  |  104 lines

  1. /* Compare for Directory Opus 5.5
  2.    by Leo 'Nudel' Davidson for Gods'Gift Utilities
  3.    email: leo.davidson@keble.oxford.ac.uk  www: http://users.ox.ac.uk/~kebl0364
  4.  
  5. $VER: Compare.dopus5 1.4 (13.6.95)
  6.  
  7.    Using an external AmigaDOS compare program, this will compare either:
  8. a) the first two selected entries in the source lister (if more than one
  9.    entry is selected in the source lister), or,
  10. b) the selected entry in the source lister with the first selected entry
  11.    in the destination lister.
  12.  
  13.     Whether comparing two directories works or not depends on the compare
  14.     command you use (see below).
  15.  
  16. Call as:
  17. ------------------------------------------------------------------------------
  18. ARexx    Compare.dopus5 {Qp}
  19. ------------------------------------------------------------------------------
  20. Flags: Output to window
  21.        Window close button
  22.  
  23. You should change the "Address Command..." line near the end to work with
  24. whatever Compare command you prefer to use (you'll at least have to change
  25. it's path).
  26.  
  27. */
  28.  
  29. /*-- Main Program -----------------------------------------------------------*/
  30. options results
  31. options FAILAT 99
  32. signal on syntax;signal on ioerr
  33. PARSE ARG DOpusPort
  34.  
  35. If DOpusPort="" THEN Do
  36.     Say "Not correctly called from Directory Opus 5!"
  37.     Say "Load this ARexx script into an editor for more info."
  38.     EXIT
  39.     END
  40. If ~Show("P",DOpusPort) Then Do
  41.     Say DOpusPort "is not a valid port."
  42.     EXIT
  43.     End
  44. Address value DOpusPort
  45.  
  46. /* Thanks Edmund */
  47. dopus version
  48. If ( result='RESULT' | translate(result,'.',' ') < 5.1218 ) then do
  49.     dopus request '"This script requires DOpus v5.5 or greater." OK'
  50.     EXIT
  51.     end
  52.  
  53. lister query source stem source_handle.
  54.  
  55. If source_handle.count = 0 then Do
  56.     dopus request '"You must have a source lister" OK'
  57.     EXIT
  58.     End
  59.  
  60. lister query source_handle.0 numselentries
  61. If RESULT = 0 Then Do
  62.     dopus request '"You must have at least one entry' || X2C(0A) || 'selected in the source lister" OK'
  63.     EXIT
  64.     End
  65.  
  66. lister query source_handle.0 firstsel
  67. First_Name = RESULT
  68. lister select source_handle.0 First_Name 0
  69. lister query source_handle.0 path
  70. First_Name = Strip(RESULT,"B",'"')||Strip(First_Name,"B",'"')
  71. lister refresh source_handle.0
  72.  
  73. lister query source_handle.0 numselentries
  74. drop source_handle.count
  75. If RESULT = 0 Then Do
  76.     lister query dest stem source_handle.
  77.     IF source_handle.count = 0 | source_handle.count = "SOURCE_HANDLE.COUNT" Then Do
  78.         dopus request '"If you do not select two entries in the source lister,' || X2C(0A) || 'you must have a destintion lister" OK'
  79.         EXIT
  80.         END
  81.     END
  82.  
  83. lister query source_handle.0 numselentries
  84. If RESULT = 0 Then Do
  85.     dopus request '"You must select a second entry in' || X2C(0A) || 'either the soure or destination lister" OK'
  86.     EXIT
  87.     END
  88.  
  89. lister query source_handle.0 firstsel
  90. Second_Name = RESULT
  91. lister select source_handle.0 Second_Name 0
  92. lister query source_handle.0 path
  93. Second_Name = Strip(RESULT,"B",'"')||Strip(Second_Name,"B",'"')
  94. lister refresh source_handle.0
  95.  
  96. Say 'Compare: "'First_Name'"'
  97. Say '   with: "'Second_Name'"'
  98. Say
  99.  
  100. Address Command 'DH0:Tools/System/Utils/Compare "' || First_Name || '" "' || Second_Name || '"'
  101.  
  102. syntax:;ioerr:                /* In case of error, jump here */
  103. EXIT
  104.