title: Windows batch variables
body: <p>I have problem with getting value from variable trought two other variable. May sound complicated cause my english is not best.</p>
  
  <p>I use variable rXY, to make xy grid, where X is x pos and Y is y pos. I filled grid with random chars but now I want to get value of one point. </p>
  
  <p>echo %r23% will work, but if I ask coordinates from user (set /P p_x=) then
  echo %r%p_x%%p_y%% will not work.</p>
  
  <p>Is it even possible to get value this way?</p>
  
  <p>Example of code:</p>
  
  <pre><code>echo off
  cls
  FOR /L %%Y IN (1,1,4) DO (FOR /L %%X IN (1,1,4) DO set r%%X%%Y=.)
  
  echo Y
  echo 4 %r14% %r24% %r34% %r44%
  echo 3 %r13% %r23% %r33% %r43%
  echo 2 %r12% %r22% %r32% %r42%
  echo 1 %r11% %r21% %r31% %r41%
  echo 0 1 2 3 4 X
  
  set /P input=Please enter X and Y pos:
  set p_x=%input:~0,1%
  set p_y=%input:~1,2%
  echo X=%p_x%
  echo Y=%p_y%
  echo [2,3]=%r23%
  
  echo %r%p_x%%p_y%
  pause
  </code></pre>