I am trying to combine the result of two variables , to a new
variable.
This new variable should be set to false and and the if statement
should do the rest.
@ECHO OFF
::ECHO ON
SET BLABEL7=0432a_04
SET TYPE=_W32BP
ECHO %BLABEL7%
ECHO %TYPE%
ECHO.%BLABEL7%%TYPE%
SET %BLABEL7%%TYPE%=FALSE
ECHO %BLABEL7%
ECHO %TYPE%
ECHO %BLABEL7%%TYPE%
IF ==FALSE ECHO."THIS IS FALSE"
ECHO."THIS IS THE end"
I call that 'indirection' and it's tricky in batch. Here is one
way ...
%comspec% /c IF '%%%BLABEL7%%TYPE%%%'=='FALSE' ECHO."THIS IS FALSE"
Watch out for those percent signs ;-)
Unfortunately, that doesn't help if you want to use it for branching.
In that case, you might want something like this ...
%COMSPEC% /C echo.%%%BLABEL7%%TYPE%%% | find /i "false" > nul
if %errorlevel% EQU 0 goto :False
goto NotFalse
:False
echo."THIS IS FALSE"
:NotFalse
ECHO."THIS IS THE end"
In XP the %COMSPEC% /C can be replaced with a simple CALL. However,
in Win2K (and earlier), that trick doesn't work.
Tom Lavedas
===========
This solution developed using XP
It may work for NT4/2K
----- batch begins -------
[1]@ECHO OFF
[2]::ECHO ON
[3]SET BLABEL7=0432a_04
[4]SET TYPE=_W32BP
[5]
[6]ECHO %BLABEL7%
[7]ECHO %TYPE%
[8]ECHO.%BLABEL7%%TYPE%
[9]
[10]SET %BLABEL7%%TYPE%=FALSE
[11]
[12]ECHO %BLABEL7%
[13]ECHO %TYPE%
[14]ECHO %BLABEL7%%TYPE%
[15]
[16]for /f "tokens=1*delims==" %%i in ( ' set %BLABEL7%%TYPE% ' ) do set
result=%%j
[17]
[18]IF %result%==FALSE ECHO."THIS IS FALSE"
[19]ECHO."THIS IS THE end"
------ batch ends --------
Lines start [number] - any lines not starting [number] have been wrapped and
should be rejoined. The [number] that starts the line should be removed
The spaces surrounding the single-quotes are for emphasis only. The SPACES
are not required but the single-quotes ARE required.