title: Delphi Error: Got "untyped", expected "AnsiString"
body: <p>Below is a sample from a file preview system project that I am working on. There are two ListBoxes on the main form. The first one, [lst_fileList], displays a list of all ".txt" files in a directory [files], each labeled [order###.txt], with the ### being any number from 1 to 999. When the procedure is run, it finds the selected item in the listbox, (a .txt file), and then displays each individual line from within the file upon the second ListBox [lst_filePreview].</p>
  
  <p>Although as I run it, an error occurs on the 21st line at the ReadLn(selectedFile). The error states (Incompatible Type: Got "untyped", expected "AnsiString").</p>
  
  <p>I have looked into this error for a few hours now, to no avail... Any help would be appreciated, thank you.</p>
  
  <hr>
  
  <pre><code>procedure TForm1.btn_getPreviewClick(Sender: TObject);
  var
    checkSelect:integer;
    orderSelect:string;
    i:integer;
    selectedFile:textFile;
  begin
    if lst_fileList.SelCount &gt; 0 then
    begin
      for checkSelect:= 0 to (lst_fileList.Items.Count - 1) do
      if lst_fileList.Selected [checkSelect] then
      begin
        orderSelect:=lst_fileList.Items[checkSelect];
        orderSelect:=RightStr(orderSelect,3);
        if fileexists('files\order'+orderSelect+'.txt') then
        begin
          assignFile(selectedFile,'files\order'+orderSelect+'.txt');
          reset(selectedFile);
          while not EOF(selectedFile) do
          begin
            lst_filePreview.Items.Add(readLn(selectedFile));    // Error occurs here: //
          end;
          closeFile(selectedFile);
        end;
      end;
    end else
    ShowMessage('Please select an item first!');
  end;
  </code></pre>