How do i get different vars changed in a for loop with every run?
assume:
for %%i in (
VAR:RUN1,RUN2,RUN3,RUN4,RUN5,RUN6,RUN7,RUN8,RUN9
var1:1,2,3,4,5,6,7,8,9
var2:10,20,30,40,50,60,70,80,90
var3:a,b,c,d,e,f,g,h,i
var4:x,y,x,y,x,y,x,y,x
) do (
echo %var1% %var2% %var3% %var4%
)
while there are e.g. 9 different values of each var?
or to order the vars better way:
for %%i in (
LoopRUN:VAR1,VAR2,VAR3,VAR4
run1:1,10,a,x
run2:2,20,b,y
run3:3,30,c,x
run4:4,40,d,y
run5:5,50,e,x
run6:6,60,f,y
run7:7,70,g,x
run8:8,80,h,y
run9:9,90,i,x
) do (
echo %var1% %var2% %var3% %var4%
)
This should result in something like this:
C:\>1,10,a,x
2,20,b,y
3,30,c,x
4,40,d,y
5,50,e,x
6,60,f,y
7,70,g,x
8,80,h,y
9,90,i,x
EDIT:
I can't see how to get the correspondense clearly between the vars and calls.
It is a bit more difficult, instead of "echo" there is a call in each run/loop likewise:
"command /S %VAR1% -subswitch %VAR2% /H %VAR3% -o %VAR4%"
EXPLANATION:
With choosen solution it is possible to use REM lines to keep runs overview-able likewise:
REM Devicegroup A
run1
run2
run3
REM Devicegroup B
run4
run5
REM
Even if one forgets to set one VAR this is handled by code, the only problem will be if you use "run[x]..." a second time so keep an eye on your run-numbering!
While runs are done in not natural order, don't know if we could catch this. See Output:
command /S 10 -subswitch 10 /H a -o x
command /S 11 -subswitch 10 /H a -o x
command /S 12 -subswitch 20 /H b -o y
command /S 13 -subswitch 30 /H c -o x
command /S 14 -subswitch 40 /H d -o y
command /S 15 -subswitch 50 /H e -o x
ERROR: Missing variable in run[16]
command /S 17 -subswitch 70 /H g -o x
command /S 18 -subswitch 80 /H h -o y
command /S 19 -subswitch 90 /H i -o x
command /S 1 -subswitch 10 /H a -o x
command /S 20 -subswitch 20 /H b -o y
command /S 2 -subswitch 20 /H b -o y
command /S 3 -subswitch 30 /H c -o x
command /S 4 -subswitch 40 /H d -o y
command /S 5 -subswitch 50 /H e -o x
ERROR: Missing variable in run[6]
command /S 7 -subswitch 70 /H g -o x
command /S 8 -subswitch 80 /H h -o y
command /S 9 -subswitch 90 /H i -o x