{
AssignFile, OpenDialog, Readln, CloseFile example
Use a TOpenDialog to select a file.  Place the first line of the
file into a TEdit. 
}
var 
  F: TextFile;
  S: string;
begin
  if OpenDialog1.Execute then            { Display Open dialog box }
  begin
    AssignFile(F, OpenDialog1.FileName); { File selected in dialog }
    Reset(F);
    Readln(F, S);                        { Read first line of file }
    Edit1.Text := S;                     { Put string in a TEdit control }
    CloseFile(F);
  end;
end; 
