title: Integer to custom type conversion in Ada
body: <p>I have an array of some kind of objects, indexed by a type <code>index</code>:</p>
  
  <pre><code>type index is new Integer range 1..50;
  type table is new Array(index) of expression;
  </code></pre>
  
  <p>Now, I need to access one of these expressions, depending on a user entry by keyboard. For that I do following:</p>
  
  <pre><code>c: Character;
  get(c);
  
  s: String := " ";
  s(1) := c;
  </code></pre>
  
  <p>Finally I can cast the character to type <code>Integer</code>:</p>
  
  <pre><code>i: Integer;
  i := Integer'Value(s);
  </code></pre>
  
  <p>Now, I have the position of the value the user want to access, but Ada doesn't let you access to <code>table</code>, because it is indexed by <code>index</code> and not <code>Integer</code>, which are different types.</p>
  
  <p>What would be the best solution, to access an expression based on the user's input?</p>