title: Ada: Getting user input to a String(1..10) and filling the rest with whitespace
body: <p>I have defined</p>
  
  <pre><code>subtype String10 is String(1..10);
  </code></pre>
  
  <p>and I am attempting to get keyboard input to it without having to manually enter whitespace before hitting enter. I tried get_line() but from some reason it wouldn't actually wait for input before outputting the get put() command, and I also think it will just leave whatever was in the string before there and not fill it with white space.</p>
  
  <p>I know about and have used Bounded_String and Unbounded_String, but I am wondering if there is a way to make this work.</p>
  
  <p>I've tried making a function for it:</p>
  
  <pre><code>--getString10--
  procedure getString10(s : string10) is
     c : character;
     k : integer;
  begin
     for i in integer range 1..10 loop
        get(c);
        if Ada.Text_IO.End_Of_Line = false then
           s(i) := c;
        else
           k := i;
           exit;
        end if;
     end loop;
  
     for i in integer range k..10 loop
        s(i) := ' ';
     end loop;
  end getString10;
  </code></pre>
  
  <p>but, here, I know the <code>s(i)</code> doesn't work, and I don't think the</p>
  
  <pre><code>"if Ada.Text_IO.End_Of_Line = false then" 
  </code></pre>
  
  <p>does what I'm hoping it will do either. It's kinda just a placeholder while I look for the actual way to do it.</p>
  
  <p>I been searching for a couple hours now, but Ada documentation isn't as available or clear as other languages. I've found a lot about getting strings, but not what I'm looking for.</p>