title: Is it possible to have a variable name include other variables?
body: <p>I have a batch file I am working on that I need to have a variable name be changeable.  What I mean by this is I have a list of variables named <code>%X0Y0U%</code> to <code>%X9Y9U%</code> all of which are either set to 1 or 0 and one of the variables is set to 2(this can change if needed).  I have a later part of the batch file do this:</p>
  
  <pre><code>set TEMPLOC=X%Xcoord%Y%Ycoord%U
  if %TEMPLOC% EQU 1 (
       random code
  ) ELSE if %TEMPLOC% EQU 0 (
       random code
  ) ELSE if %TEMPLOC% EQU 2 (
       random code
  )
  </code></pre>
  
  <p>Then the batch file has a part I know works already.  What I need to know is how I can have <code>%TEMPLOC%</code> equal the value of the variable <code>%X#Y#U%</code>.  The <code>#'s</code> are representing a number between <code>0</code> and <code>9</code> and are not always the same for both of the <code>#'s</code>.  I would like to, in short, be able to do this (this is a very literal version of it) <code>%X %Xcoord% Y %Ycoord% U%</code> , minus the spaces.  I do know that what I have stated is not possible as it will read as <code>%X% Xcoord %Y% Ycoord %U%</code> , again minus the spaces.  Please help me as I am very puzzled as to how to do this.</p>
  
  <p>If you do not understand or need me to add more of my code, <b>please</b> say so in the comments.</p>