07-23-2023, 10:30 AM
I have a batch file which contains nested loop with `continue`-like command:
for %%i in (1, 2, 4, 8, 16, 32, 64, 128, 256) do (
for %%j in (1, 2, 4, 8, 16, 32, 64, 128, 256) do (
if %%i gtr %%j goto CONTINUE
test.exe 0 %%i %%j 100000 > "%%i_%%j".txt
:CONTINUE
rem
)
)
But when `if` statement is true for the first time, it does not iterate further. I only get text files upto `1_256.txt`. So it seems that `goto CONTINUE` has a problem. What is wrong with my batch file?
for %%i in (1, 2, 4, 8, 16, 32, 64, 128, 256) do (
for %%j in (1, 2, 4, 8, 16, 32, 64, 128, 256) do (
if %%i gtr %%j goto CONTINUE
test.exe 0 %%i %%j 100000 > "%%i_%%j".txt
:CONTINUE
rem
)
)
But when `if` statement is true for the first time, it does not iterate further. I only get text files upto `1_256.txt`. So it seems that `goto CONTINUE` has a problem. What is wrong with my batch file?