Aha...thanks for the solution! I was having the same problem. FOr
anyone who needs it, here's my code (for parsing a tab-delimited
file):
FOR /F "usebackq tokens=1,2* delims=%tabspaces%" %%a in (%1) DO (
call :replacem %%a %%b
)
:replacem
set aa=%1
set bb=%2
set aa=%aa:"=%
set bb=%bb:"=%
echo stuff here
Hope that helps someone.
Mike
--- In
batchworld@..., foxidrive <foxidrive@...> wrote:
>
> On Mon, 18 Feb 2008 22:17:58 -0000, "vij_guy102" <vij_guy102@...>
> wrote:
>
> >inside an 'if' block or 'for' loop, the SET variable is not
> >substituted. I had to finally use the GOTO labels to do away
with 'if'
> >block. I tried CMD /V:ON to enable the delayed execution, but the
> >script won't go beyond that.
> >
> >Any solution to this?
>
> @echo off
> setlocal enableddelayedexpansion
>
> and use !variable! inside the block instead of %variable%
>
>
> Or call a subroutine to set the variable outside the block.
>