title: Pascal Runtime Error 106 on Homework
body: <p>First time posting here so I will try to do it right.</p>
  
  <p>I'm working on my first program which prints the percentages for a class of students given an id,last &amp; first name, and an assignment score which must be converted. I was able to compile it with only two warnings about assignment_score and assignment_percentage being uninitialized.  </p>
  
  <p>I'm getting runtime error 106 (which is when a nonnumeric value is read where a numeric value is expected) in my read_record, initialize, and main modules (I think that's the term).</p>
  
  <p>It has to do with the spacing in the data file, but maybe I did something wrong in the code, as this is my first program I am looking for any help possible.</p>
  
  <p>Read_Record :</p>
  
  <pre><code>begin
    if EoF(FileIn) then
      more_students := False
    else
      readln(FileIn,student_id,last_name,first_name,assignment_score)
  end; {read_record}
  </code></pre>
  
  <p>Initialize:</p>
  
  <pre><code>Procedure initialize;
  begin
    more_students:= True;
  
    {Assigns files to input and output and rewrites them for the code }
    Assign(FileIn, 'prg2a-150.dat');
    Reset(FileIn);
    Assign(Fileout, 'Prog2.txt');
    Rewrite(fileout);
  
    READ_RECORD;
    Print_Header
  end; { initialize }
  </code></pre>
  
  <p>My process &amp; main (I get an error at line 100 when I call for process to be used which is where I'm writing my FileOut)</p>
  
  <pre><code>procedure process;
  begin
    {Line check for print header}
  
    if line_count &gt; 57 then
      print_header;
  
    Inc(line_count);
  
    { Converts score to percentage }
    compute_grade;
  
    {Report Percentage}
    writeln(FileOut, student_id, space(2), last_name, space(1), first_name, space(2), assignment_percentage:5:1);
  
    { Next Runner Data }
    read_record
  end; { process }
  
  
  {WRAP UP -- No summary so  just the files are being closed }
  procedure wrapup;
  begin
    close(FileOut);
    close(FileIn)
  end; { wrapup }
  
  begin { main }
    initialize;
  
    while more_students do
      process;
  
    wrapup
  end.
  </code></pre>
  
  <p>And finally, here is my data file:</p>
  
  <pre><code>032919631 BACH                AMANDA    14.1 
  
  327777582 GUNDERSON           EMILY      9.9 
  
  188941863 DARLING             CHRIS     14.7 
  
  396501493 JACKSON             GUY        2.1 
  
  552753315 MILKOVICH           LAURA 21.0 
  
  553962171 ZADINS              WALLACE   28.9 
  
  989570643 KLIPP               JOAN      33.3 
  
  468497243 CARPENTER           BETTYANNE 6.0 
  
  112324230 RIKER               NANCY     17.1 
  
  720789066 UTHE               SHARON    12.7 
  
  878468839 NULL                LIVAK      0.0 
  
  606537736 ZUCKERMAN           YVONNE     1.0 
  
  996498720 KINGSLIGHT         JERRIE    14.5 
  
  453310627 GAUTHIER            DONALD     7.8 
  
  289324008 HIRSH               GAYLENE   32.3 
  
  361582495 KELLY               JEAN 0.1 
  
  441892834 FACTOR              DANI      15.8 
  
  255715006 MARKS               KIMBERLEE 8.9 
  
  535282507 MORROW              LEONARD   29.8 
  
  566318464 COSGROVE            CAROL     15.8 
  
  158778873 MUDD                LES  29.1 
  
  574450163 TIMMERMAN           ROY        2.9 
  
  032731233 MUIZNIECE           LESLIE    14.3 
  
  832142931 HARMAN              FRITZ     34.5
  </code></pre>