title: Reading a text file into an array in PASCAL
body: <p>I have a text file "text.txt" that contains</p>
  
  <pre><code>48 42
  </code></pre>
  
  <p>I am trying to read the text file and assign it into an array. After that I am trying to assign the numbers into num1 and num2 variables.</p>
  
  <p>Below is what I have right now. For some reason, it does not assign the numbers using array index.</p>
  
  <pre><code>program tutorial15;
    var
      infile, outfile: text;
      inputchar: char;
      num1: integer;
      num2: integer;
    begin
      assign(infile, 'text.txt');
      reset(infile);
      while not eof(infile) do
        begin
          while not eoln(infile) do
            begin
              read(infile, inputchar);
            end;
            num1 := inputchar[0];
            num2 := inputchar[1];
        end;
      writeln('Number1: ', num1);
      writeln('Number2: ', num2);
    end.
  </code></pre>
  
  <p>I am new to Pascal, please let me know what I could do to solve this problem!</p>