I have a batch file containing a nested loop with the continue-like command :
continue
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 the statement ifis true for the first time, it does not perform further iteration. I only get text files before 1_256.txt. So it seems like a problem goto CONTINUE. What is wrong with my batch file?
if
1_256.txt
goto CONTINUE
goto :Label (), for, , :Label . if, goto, ths answer, goto :Label call :
goto :Label
()
for
:Label
goto
call
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 ( call :SUB %%i %%j ) ) exit /B :SUB outer inner if %1 gtr %2 goto CONTINUE test.exe 0 %1 %2 100000 > "%1_%2.txt" :CONTINUE rem exit /B
, , " "., " ", LEQ?, , test.exe .txt %% i_ %% j. echo.
LEQ
echo
,
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 LEQ %%j test.exe 0 %%i %%j 100000 > "%%i_%%j".txt ) )