home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 September / PCO_0998.ISO / filesbbs / dos / afx_511.exe / DEVELOP.ZIP / FILEAREA.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-02-08  |  1.4 KB  |  47 lines

  1. (******************************************************************************)
  2. (*                          ALLFIX sample procedures                          *)
  3. (*    Copyright (C) 1992,98 Harms Software Engineering, all rights reserved   *)
  4. (*                                                                            *)
  5. (*                 All information in this documentation is                   *)
  6. (*                  subject to change without prior notice                    *)
  7. (******************************************************************************)
  8.  
  9. Uses Types;
  10.  
  11. Procedure ReadFileAreas;
  12.  
  13.   (* This procedure demonstrates how to read in the FILEAREA.FIX file   *)
  14.  
  15.   (* Please note that it is very important to set the record size to 1, *)
  16.   (* since this file has two different record sizes in it               *)
  17.  
  18.   Var f      : file;
  19.       {$IFDEF OS2}
  20.       Nr     : longint;
  21.       {$ELSE}
  22.       Nr     : word;
  23.       {$ENDIF}
  24.       Header : FileAreaHeader;
  25.       Rec    : FileAreaRecord;
  26.  
  27.   Begin
  28.     WriteLn('Reading FILEAREA.FIX');
  29.  
  30.     Assign(f, 'FILEAREA.FIX');
  31.     Reset(f,1);
  32.  
  33.     Blockread(f, Header, Sizeof(Header), Nr);
  34.     Blockread(f, Rec, Sizeof(Rec), Nr);
  35.     While Nr > 0 Do
  36.     Begin
  37.       WriteLn(Rec.Name);
  38.       Blockread(f, Rec, Sizeof(Rec), Nr);
  39.     End;
  40.  
  41.     Close(f);
  42.   End;
  43.  
  44. Begin
  45.   ReadFileAreas;
  46. End.
  47.