I have a below code and I cannot get the timeout: !timeout[%i%]! value displayed. It should be 120.
@echo off
setlocal enableextensions enabledelayedexpansion
set /A "x = 0"
set /A "timeout[1] = 120"
set /A "timeout[2] = 130"
if !x! equ 0 (
set /A "i = !x! + 1"
echo x: !x!, i: !i!, timeout: !timeout[%i%]!
pause
)
endlocal
Already tried %timeout[%i%]%, !timeout[!i!]!