Posted by 20080425 on April 25, 2008 at 19:00:37:
In Reply to: DOS Dynamic Variable Naming posted by drumsticks on April 25, 2008 at 15:24:20:
: Is it possible to create a variable name from the value of another variable, such as like a utopian example below (I don't think an EVAL function exists):
: SET variableOne=variableTwo
: SET EVAL(variableOne)=example Text
: %variableTwo%
: Thanks for any input or direction!
##
Yes, for example:
---[cut here]---
@echo off
echo Command: set VariableOne=VariableTwo
set VariableOne=VariableTwo
echo Results: VariableOne=%VariableOne%
echo.
echo Command: set %%VariableOne%%=Example Text
set %VariableOne%=Example Text
echo Results: VariableTwo=%VariableTwo%
---[cut here]---