home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1995 November
/
PCWK1195.iso
/
inne
/
podstawy
/
dos
/
4dos
/
4uzytki
/
ez-btm11.exe
/
COMPARE.BTM
< prev
next >
Wrap
Text File
|
1994-01-09
|
2KB
|
90 lines
@echo off
: COMPARE.BTM
: March 21, 1992, Itamar Even-Zohar
: Edited: March 7, 1993
: Allows ommitting output filename when comparing files with CompareRite.
: (I wrote it because I often forget to invent such an output filename.)
: This batch file creates an output filename by using the name of the
: second file, adding the extension CMP to it.
: The CMP file will be created in the current path even if one, or both, of
: the files compared is/are in a different path.
: *Note:* If no filename is used, COMPARE runs in menu mode.
:
: CompareRite (c) by JURISoft Inc., 763 Massachusetts Ave., Cambridge,
: MA 02139 (phone [617] 864-6151) is a program for versions comparison.
if "%&" =="" goto RUN
if "%3" =="" goto OUTPUT
:RUN
%@search[compare.Com] %1&
goto EXIT
:OUTPUT
rem check first if the files to be compared exist!
iff not exist %1 .AND. not exist %2 then
beep^Echo both File %@upper[%1] and File %@upper[%2] do not exist
quit
endiff
iff not exist %1 .OR. not exist %2 then
goto :exist?
else
goto CHECK
endiff
:exist?
iff not exist %1 then
beep^Echo File %@upper[%1] does not exist; aborted
quit
endiff
iff not exist %2 then
beep^Echo File %@upper[%2] does not exist; aborted
quit
endiff
:check
gosub CHECKBACK
iff %@INDEX[%2,.] ge 0 then
set num=%@INDEX[%second,.]
set third=%@SUBSTR[%second,0,%num].Cmp
compare.Com %1 %2 %third
else
set third=%second.Cmp
compare.Com %1 %2 %third
endiff
echo.
echo ==`>` OUTPUT file name is: %@UPPER[%third]
unset num second third
quit
:CHECKBACK
rem This routine checks if one or more backslashes are contained
rem in the second filename, using a loop parsing to get the filename
rem without its path for creating the name of the output file.
iff %@index[%2,\] ge 0 then
:PARS
set num=%@EVAL[%@index[%2,\]+1]
set second=%@substr[%2,%num]
goto 2check
else
set second=%2
return
endiff
:2check
iff %@index[%second,\] ge 0 then
set num=%@EVAL[%@index[%second,\]+1]
set second=%@substr[%second,%num]
goto 2check
else
return
endiff
:EXIT