"continue" equivalent command in nested loop in windows batch

I have a batch file containing a nested loop with the 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 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?

+4
source share
2 answers

goto :Label (), for, , :Label . if, goto, ths answer, goto :Label 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
+3

, , " ".
, " ", LEQ?
, , test.exe .txt %% i_ %% j. 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
    )
)
+1

All Articles