home *** CD-ROM | disk | FTP | other *** search
- /* Compare v1.01 [13-May-1995] for Directory Opus 5
- By Leo Davidson ("Nudel", P0T-NOoDLE/Gods'Gift Utilities)
-
- 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.
-
- Where multiple soure/destination listers are open, only those listed
- first by DOpus5 will be used - so for the desired results you should
- only have one source and one destination lister (or just one source
- if you have two entries selected in it).
-
- Note: Whether comparing two directories, or even a directory with a
- file, works or not depends on the "Compare" command you use. This
- script will send the selected ENTRIES (file OR dir!) to the command -
- after this what happens is entirely up to the command itself!
-
- Call as:
- ------------------------------------------------------------------------------
- ARexx Compare.dopus5 {Qp}
- ------------------------------------------------------------------------------
- The "Output to window" and "Window close button" switches should both be on.
-
- 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 Address value DOpusPort
- ELSE Do
- Say "Not correctly called from Directory Opus 5!"
- Say "Load this ARexx script into editor for more info."
- EXIT
- END
-
- lister query source
- IF RC ~= 0 Then Do
- dopus request '"You must have a SOURCE lister!" OK'
- EXIT
- End
- Source_Handle = WORD(RESULT,1)
-
- lister query Source_Handle 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 firstsel
- First_Name = RESULT
- lister select Source_Handle First_Name 0
- lister query Source_Handle path
- First_Name = Strip(RESULT,"B",'"')||Strip(First_Name,"B",'"')
- lister refresh Source_Handle
-
- lister query Source_Handle numselentries
- If RESULT = 0 Then Do
- lister query dest
- IF RC ~= 0 Then Do
- dopus request '"If you do not select TWO entries in the SOURCE lister,' X2C(0A) 'you must have a DESTINTION lister as well!" OK'
- EXIT
- END
- Source_Handle = WORD(RESULT,1)
- END
-
- lister query Source_Handle numselentries
- If RESULT = 0 Then Do
- dopus request '"You must select a second entry in' X2C(0A) 'either the SOURE or DEST lister!" OK'
- EXIT
- END
-
- lister query Source_Handle firstsel
- Second_Name = RESULT
- lister select Source_Handle Second_Name 0
- lister query Source_Handle path
- Second_Name = Strip(RESULT,"B",'"')||Strip(Second_Name,"B",'"')
- lister refresh Source_Handle
-
- 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
-