title: searching an unindexed File-of-Record in pascal (Delphi 7)
body: <p>Im creating a console app for a friend using Pascal on Delphi 7. Ive sorted adding a record and viewing them, but Im having problems in searching them. The records are stored in a .dat file. Any help would be great! </p>
  
  <p>Thanks! </p>
  
  <p>my code so far...</p>
  
  <pre><code>Type
    BookRecord = Record
      Number : Integer;
      Title  : String[50];
      Author : String[50];
      ISBN   : String[13];
    end;
  
  Var
    Book : BookRecord;
    f    : file of BookRecord ;   
  
  Procedure Add_Book;
  Var
    Title, Author, ISBN : String;
    i : integer;
  Begin
    Assign (f, 'Books.dat');
    reset (f);
    Seek (f, filesize(f));
    Book.Number := (filepos(f)+1);
    Write  ('Title:  ');
    Readln (Title);
    For i := 1 to Length(Title) do
      Title[i] := UpCase(Title[i]);
    Book.Title := Title;
    Write  ('Author: ');
    Readln (Author);
    For i := 1 to Length(Author) do
      Author[i] := UpCase(Author[i]);
    Book.Author := Author;
    Write  ('ISBN:   ');
    readln (ISBN);
    For i := 1 to Length(ISBN) do
      ISBN[i] := UpCase(ISBN[i]);
    Book.ISBN := ISBN;
    write (f, Book);
    Close (f);
  End;
  
  Procedure Show_All;
  Begin
    Assign (f, 'Books.dat');
    Reset (f);
    while FilePos(f) &lt;&gt; FileSize(f) do
    Begin
      Read (f,book);
      Writeln ('File:   ' , Book.Number);
      Writeln ('Title:  ' , Book.Title);
      Writeln ('Author: ' , Book.Author);
      Writeln ('ISBN:   ' , Book.ISBN);
      Writeln;
    end;
    Writeln; Writeln;
    Center ('END OF FILE!');
    readln;
    Close (f);
  end;
  
  Procedure Delete_All;
  Begin
    Assign (f, 'Books.Dat');
    Reset (f);
    Seek (f,0);
    Truncate (f);
    Close (f);
  end;
  </code></pre>
  
  <p>Thats basically my code so far... The Add_Book, Show_All and Delete_All Procs work great, but once Ive added some records how would I go about searching for an author? </p>