我编写了一个批处理文件并尝试在循环内打印数组值。但价值不是回声。 我试过了
@echo off
setlocal EnableDelayedExpansion
REM value in allargu -count 100 -delay 100
REM I want a count value 100 in variable
set "allargu="
set n=0
for %%a in (%*) do (
set /A n+=1
set "allargu[!n!]=%%~a"
pause
)
REM For example, to process the filenames:
set /a iter=1
for /L %%i in (1,1,%n%) do (
echo %%i- !allargu[%%i]!
set /a iter=%%i
set eachelement=!allargu[%%i]!
if "!eachelement!" EQU "-count" (
set /a iter+=1
REM here I want to print 100 if count found
echo %allargu[!iter!]%
)
)
谢谢,