TCC 24.02.50 x64 Windows 10 [Version 10.0.18362.239]
TCC Build 50 Windows 10 Build 18362
According to the help the internal variable %_do_loop contains "The number of times the current DO loop has been executed". I read that to mean that if Do loops are nested, then %_do_loop will return the correct value for the "currently active" loop. So I would expect this test code:
to return this:
However, what it actually returns is:
It seems that on return from the nested Do, the internal variable is left with its last value from the nested loop.
TCC Build 50 Windows 10 Build 18362
According to the help the internal variable %_do_loop contains "The number of times the current DO loop has been executed". I read that to mean that if Do loops are nested, then %_do_loop will return the correct value for the "currently active" loop. So I would expect this test code:
Code:
@echo off
do 3
echo %_do_loop
do 5
echos %_do_loop` `
enddo
echo ``
echo %_do_loop
echo ``
enddo
to return this:
Code:
1
1 2 3 4 5
1
2
1 2 3 4 5
2
3
1 2 3 4 5
3
However, what it actually returns is:
Code:
1
1 2 3 4 5
6
2
1 2 3 4 5
6
3
1 2 3 4 5
6
It seems that on return from the nested Do, the internal variable is left with its last value from the nested loop.