如下:
set a1=""
set a2=""
set a3=""
…
set numArr=1,2,3...
for %%i in (numArr) (
rem 这里我想拼接 a 跟数字 (a%%i)
rem 然后把拼接结果当做变量用(这个效果%a1%)
rem 请问怎么写
)
@echo off
setlocal enabledelayedexpansion
set a1=变量a1的值
set a2=变量a2的值
set a3=变量a3的值
set numArr=1,2,3
for %%i in (%numArr%) do (
echo a%%i=!a%%i!
)
pause