I am new to batch and I don\'t understand when to use late variable expansion or normal expansion. Below I have a test script in which I have tested the variables expansion.
This can work depending on the text being parsed, as poison characters can affect it.
@echo off
set var=0
echo late var=%var%
echo var=%var%
for /F "delims= " %%A in (temp.txt) do call :next "%%A"
goto :EOF
:next
echo Analyzing %~1
set line=%~1
echo line=%line%
echo late line=%line%