Hello,
I have used Endlocal / Setlocal inside a DO loop and it works. I thought that Endloop discards all Variables set since last SetLocal. EndLocal does not discurd the D loop variable:
Variable N is alive after IF triggers EndLocal.
This behaviour is usefull in this case but I still wonder why N is alive. N must be special here.
- Heinz Saathoff
I have used Endlocal / Setlocal inside a DO loop and it works. I thought that Endloop discards all Variables set since last SetLocal. EndLocal does not discurd the D loop variable:
Code:
SetLocal
Set M=Par is
DO N in /L One Two 3 Four 5 Six
Echo %M %N
IF %N == 3 EndLocal
ENDDO
This behaviour is usefull in this case but I still wonder why N is alive. N must be special here.
- Heinz Saathoff