Assign Return value of -qc to Environment Variable

Two- and three-way text compare and merge issues.

Assign Return value of -qc to Environment Variable

Postby zman » Fri Jan 26, 2007 2:48 pm

I am calling:

uc -qc file1.f file2.f

from a command line.

I am returned "SAME" to the command window.

I would like to assign the return value (in this case "SAME") to an environment variable.

set return=uc -qc file1.f file1.f

does not work.

I cannot figure out how.

I do 8 file compares regularly.

Rather then looping through all 8 if only 1 is different, I would like to do a quick compare and only do a text compare if the files are different.

Any help is greatly appreciated.
User avatar
zman
Newbie
 
Posts: 3
Joined: Mon Mar 27, 2006 12:00 am

Re: Assign Return value of -qc to Environment Variable

Postby mwb1100 » Fri Jan 26, 2007 4:59 pm

Windows makes the return code of a program accessible in batch files 2 ways:

1) the ERRORLEVEL environment variable (this may be only in Win2000 and later)
2) the "if ERRORLEVEL ..." command (ever since DOS)

So you can probably do what you want with:

uc -qc file1.f file2.f
set return=%ERRORLEVEL%
User avatar
mwb1100
Basic User
Basic User
 
Posts: 42
Joined: Tue Nov 21, 2006 12:00 am


Return to Text Compare and Merge