home *** CD-ROM | disk | FTP | other *** search
- /* Compare for Directory Opus 5.5
- by Leo 'Nudel' Davidson for Gods'Gift Utilities
- email: leo.davidson@keble.oxford.ac.uk www: http://users.ox.ac.uk/~kebl0364
-
- $VER: Compare.dopus5 1.4 (13.6.95)
-
- Using an external AmigaDOS compare program, this will compare either:
- a) the first two selected entries in the source lister (if more than one
- entry is selected in the source lister), or,
- b) the selected entry in the source lister with the first selected entry
- in the destination lister.
-
- Whether comparing two directories works or not depends on the compare
- command you use (see below).
-
- Call as:
- ------------------------------------------------------------------------------
- ARexx Compare.dopus5 {Qp}
- ------------------------------------------------------------------------------
- Flags: Output to window
- Window close button
-
- You should change the "Address Command..." line near the end to work with
- whatever Compare command you prefer to use (you'll at least have to change
- it's path).
-
- */
-
- /*-- Main Program -----------------------------------------------------------*/
- options results
- options FAILAT 99
- signal on syntax;signal on ioerr
- PARSE ARG DOpusPort
-
- If DOpusPort="" THEN Do
- Say "Not correctly called from Directory Opus 5!"
- Say "Load this ARexx script into an editor for more info."
- EXIT
- END
- If ~Show("P",DOpusPort) Then Do
- Say DOpusPort "is not a valid port."
- EXIT
- End
- Address value DOpusPort
-
- /* Thanks Edmund */
- dopus version
- If ( result='RESULT' | translate(result,'.',' ') < 5.1218 ) then do
- dopus request '"This script requires DOpus v5.5 or greater." OK'
- EXIT
- end
-
- lister query source stem source_handle.
-
- If source_handle.count = 0 then Do
- dopus request '"You must have a source lister" OK'
- EXIT
- End
-
- lister query source_handle.0 numselentries
- If RESULT = 0 Then Do
- dopus request '"You must have at least one entry' || X2C(0A) || 'selected in the source lister" OK'
- EXIT
- End
-
- lister query source_handle.0 firstsel
- First_Name = RESULT
- lister select source_handle.0 First_Name 0
- lister query source_handle.0 path
- First_Name = Strip(RESULT,"B",'"')||Strip(First_Name,"B",'"')
- lister refresh source_handle.0
-
- lister query source_handle.0 numselentries
- drop source_handle.count
- If RESULT = 0 Then Do
- lister query dest stem source_handle.
- IF source_handle.count = 0 | source_handle.count = "SOURCE_HANDLE.COUNT" Then Do
- dopus request '"If you do not select two entries in the source lister,' || X2C(0A) || 'you must have a destintion lister" OK'
- EXIT
- END
- END
-
- lister query source_handle.0 numselentries
- If RESULT = 0 Then Do
- dopus request '"You must select a second entry in' || X2C(0A) || 'either the soure or destination lister" OK'
- EXIT
- END
-
- lister query source_handle.0 firstsel
- Second_Name = RESULT
- lister select source_handle.0 Second_Name 0
- lister query source_handle.0 path
- Second_Name = Strip(RESULT,"B",'"')||Strip(Second_Name,"B",'"')
- lister refresh source_handle.0
-
- Say 'Compare: "'First_Name'"'
- Say ' with: "'Second_Name'"'
- Say
-
- Address Command 'DH0:Tools/System/Utils/Compare "' || First_Name || '" "' || Second_Name || '"'
-
- syntax:;ioerr: /* In case of error, jump here */
- EXIT
-