title: Function reading from standard input without any "in" parameters
body: <p>Perhaps this is simple, and I am just missing some basic information, but I can't seem to find the answer anywhere.</p>
  
  <p>I'm writing a <code>Get_Word</code> function for class, here is the relevant section of the spec file my prof wrote:</p>
  
  <pre><code>function Get_Word return Ustring;
  -- return a space-separated word from standard input
  
  procedure Fill_Word_List(Wl : in out Ustring_Vector);
  -- read a text file from standard in and add all
  -- space-separated words to the word list wl
  </code></pre>
  
  <p>I've written the <code>Get_Word</code> function, and am trying to test it out with this code:</p>
  
  <pre><code>with Ada.Text_IO; use Ada.Text_Io;
  with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
  procedure ngramtest is
  
  Name : String(1..80);
  File : File_Type;
  Size : Natural;
  
  function Get_Word return String is
      -- I'm using a strings instead of Unbounded_Strings for testing purposes.
      Word : String(1..80) := (others =&gt; ' ');
      Char : Character;
      File : File_Type;
      Eol  : Boolean;
      I    : Integer := 1;
  begin
      --this code below, when uncommented reveals whether or not the file is open.
      --if Is_Open(File) then
      --  Word := (1..80 =&gt; 'y');
      --else
      --  Word := (1..80 =&gt; 'n');
      --end if;
      loop
          Look_Ahead(File, Char, Eol);
          if Eol then
              exit;
          elsif Char = ' ' then
              exit;
          else
              Get (File, Char);
              Word(I) := Char;
              I := I + 1;
          end if;
      end loop;
      return Word(1..Word'Last);
  end Get_Word;
  
  begin
      Put ("Enter filename: ");
      Get_Line (Name, Size);
      Open (File, Mode =&gt; In_File, Name =&gt; Name(1..Size));
      Put (Get_Word);
      Close(File);
  end ngramtest;
  </code></pre>
  
  <p>It compiles, but at runtime I get an exception telling me that the file isn't open, and the commented out section returns "nnnnnn..." meaning that the file is not open within the function.</p>
  
  <p>My question is how am I to read from standard input if i'm not allowed to use in parameters in my function? Without them the function won't be able to access files.
  Essentially, how can I "Get_Word"?</p>
  
  <p>Sorry if this is simple, but I'm completely lost.</p>