title: Pascal error - ";" expected but Else found
body: <p>I am using pascal to do an assignment but keep running into this error '";" expected but Else found'. I have seen many questions asking this and tried to use them to help myself but no luck.</p>
  
  <p>My code</p>
  
  <pre><code>Program TeamWrite;  
      Var FName, txt : String[10];  
      UserFile : Text;  
  BEGIN          
      FName := 'Team';  
      Assign(UserFile, 'C:\Team.dat');  
      Rewrite(UserFile);  
      Writeln('Enter players name and score separated by a space, type end to finish');  
      if txt = 'end' then;  
          BEGIN  
              Close(UserFile)  
          End;  
      Else  
          BEGIN  
              Readln(txt);  
              Writeln;  
              Writeln(UserFile,txt);  
          End;  
      Until(txt = 'end');  
  
  End.  
  </code></pre>