![]() |
|
[Shell] Is it possible for a variable inside of a variable? - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Shell] Is it possible for a variable inside of a variable? (/showthread.php?tid=4577232) |
Is it possible for a variable inside of a variable? - Topkek_Is_Life - Dec 9, 2014 I'm pretty rusty with batch and am looking for a way to do this or a way around it. The script is Code set var%setnum%= %str:~!str1!,!str2!%so that it would display like Code Set var1= ABCDEFGHIJKLMNOPQRSTUVWXYZ:~0,1* - WOLGA - Dec 9, 2014 You want the variable's name to correspond with a letter of the alphabet? Code setlocal enabledelayedexpansion* - White Light - Dec 9, 2014 (Dec 9, 2014 03:01 PM)Topkek_Is_Life Wrote: I'm pretty rusty with batch and am looking for a way to do this or a way around it. When you're storing a variable, you're storing the actual value of the variable and not how to get the variable. It will expand that entire line, and then perform what it says. |