- May
- 382
- 2
The following batch file never goes past the @execstr line.
output
Changing the code to using gosub reveals that execution does continue past @execst but there seems to be one extra pop of the return stack, I guess.
output
TCC 14.02.36 Windows XP [Version 5.1.2600]
TCC Build 36 Windows XP Build 2600 Service Pack 3
Code:
setlocal
set cmd=TODO. "a b"
set x=%@execstr[for %%i in (%[cmd]) (echo %%i ^&leavefor)]
echo x=%x
endlocal
quit
Code:
setlocal
set cmd=TODO. "a b"
set x=TODO.
Code:
setlocal
gosub test
echo here!
endlocal
quit
:test
set cmd=TODO. "a b"
set x=%@execstr[for %%i in (%[cmd]) (echo %%i ^&leavefor)]
echo x=%x
return
Code:
setlocal
gosub test
set cmd=TODO. "a b"
set x=TODO.
echo here!
here!
endlocal
quit
TCC Build 36 Windows XP Build 2600 Service Pack 3