title: FreePascal: Trouble with unit conversions.
body: <p>When I compile the following code, I get errors. I don't understand some of them. </p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>program Lasagna;
  
  {$mode objfpc}{$H+}
  
  uses
    {$IFDEF UNIX}{$IFDEF UseCThreads}
    cthreads,
    {$ENDIF}{$ENDIF}
    Classes, SysUtils
    { you can add units after this };
  
  {$R *.res}
  type
    TVehicle = record
      kindOfVehicle : String[30];
      numberOfWheels : Integer;
      horsePower : Real;
    end;
  
  var
    F: file of TVehicle;
    Vehicle : Array [1..3] of TVehicle;
    index : Integer;
  
  begin
       writeln('A RECORD OF DIFFERENT KIND OF VEHICLES.');
       writeln('---------------------------------------');
       writeln;
  
       AssignFile(F,'C:/Users/W/Desktop/CarRecord.dat');
       writeln('Searching for file.');
       if FileExists('C:/Users/W/Desktop/CarRecord.dat') then
          begin
            writeln('File found. Opening file.');
            Rewrite(F);
            writeln('File ready.');
            writeln;
            writeln;
  
            for index:=0 to 3 do
            begin
              writeln('Enter the following details for vehicle no. ',index);
              write('Kind of Vehicle: ');
              readln(Vehicle[index].kindOfVehicle);
              write(F,Vehicle[index].kindOfVehicle);//line 45: this is a string so why do I get an error?**
  
              {Do NOT use writeln() when writing to random access files.}
  
              write('Number of Wheels: ');
              readln(Vehicle[index].numberOfWheels);
              write(F,IntToStr(Vehicle[index].numberOfWheels));//line 51: The int is converted to string, so i shouldn't get an error?
  
              write('Horse Power of Vehicle: ');
              readln(Vehicle[index].horsePower);
              write(F, RealToStr(Vehicle[index].horsePower));//line 55:  
              end;
  
            writeln('Done. Closing File.');
            CloseFile(F);
          end
       else
           Rewrite(F);
           CloseFile(F);
           writeln('File Not Found.');
  
       Writeln('Press ANY key to close the program.');
       Readln;
  end.
  </code></pre>
  
  <p><strong>Errors</strong></p>
  
  <blockquote>
    <p>Compiling Lasagna.lpr</p>
    
    <p>Lasagna.lpr(45,49) Error: Incompatible types: got "ShortString"
    expected "TVehicle"</p>
    
    <p>Lasagna.lpr(51,60) Error: Incompatible types: got "AnsiString"
    expected "TVehicle"</p>
    
    <p>Lasagna.lpr(55,59) Error: Incompatible types: got "AnsiString"
    expected "TVehicle"</p>
    
    <p>Lasagna.lpr(70) Fatal: There were 3 errors compiling module, stopping</p>
  </blockquote>