double expansion of variables
Posted: 12 Jul 2006 07:54
Hello,
Is it possible to echo the value of a variable when the name of the variable is itself a variable.
I have (stripping other nonsence)
:loop
set cols=0
set /a c%cols%=%random%
set /a cols=%cols%+1
if cols==10 (goto :wherever) else (goto :loop)
And i want to be able to echo whatever %random% is which will be stored under whatever value is generate by c%cols%
This required (i think) a double expansion of a variable, but i cannot convince dos to do this.
Any ideas?
Is it possible to echo the value of a variable when the name of the variable is itself a variable.
I have (stripping other nonsence)
:loop
set cols=0
set /a c%cols%=%random%
set /a cols=%cols%+1
if cols==10 (goto :wherever) else (goto :loop)
And i want to be able to echo whatever %random% is which will be stored under whatever value is generate by c%cols%
This required (i think) a double expansion of a variable, but i cannot convince dos to do this.
Any ideas?