I know how you can use for /L, delayedexpansion, and arrays to create nested variables in batch files, but please hear out my scenario.
I have 400 variables created dynamically, that look like this:
%1x1% %1x2% etc. %2x1% %2x2% etc. and it goes up to 20x20.
if the user requests to change 20 x 20, they type in "20 20" and it's parsed. I'm able to set 20x20 to 0, for example, then. My problem is checking it. I want to be able to change it back to "." (which is what it is before the user requests to set it to 0) if they type in "20 20" again.
This is what it kind of looks like:
set !xVal!x!yVal!=0
How can I achieve this:
if %!xVal!x!yVal!%==0
without rewriting my whole script? Keep in mind I said it's created dynamically, so it's not a problem if I need to set up an array, which I'm not sure that will even work. That is essentially 2 for loops to create a "grid" of variables, the 1x1 to 20x20.