I have the following code:
setlocal enabledelayedexpansion
for /L %%i IN (1,1,5) do (
set /A is_echoing=0
if %%i==2 (set /A is_echoing=1)
if %%i==5 (set /A is_echoing=1)
if %is_echoing%==1 (
echo Hello World
)
)
endlocal
It is giving me an error:
( was unexpected at this time
if ==1 (
It seems the variable is_echoing is not set in the for loop. Why is this the case and what can I do about it?