07-23-2023, 10:20 AM
Suppose i have variable **a** with contents "**123**" and variable **b123** with some text in it. For some reason i want to use variable **a** as part of second var name. Something like this:
SET a=123
SET b123=some_text_in_it
rem i want next line to output "some_text_in_it"
echo %b%a%%
so i want to concatenate text with var contents and use resulting string as variable name to echo that contents. Sample above doesn't work and i see why, probably i need to add some kind of groupping. How to do it, prefferably in one line?
SET a=123
SET b123=some_text_in_it
rem i want next line to output "some_text_in_it"
echo %b%a%%
so i want to concatenate text with var contents and use resulting string as variable name to echo that contents. Sample above doesn't work and i see why, probably i need to add some kind of groupping. How to do it, prefferably in one line?