home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 September / PCO_0998.ISO / filesbbs / dos / afx_511.exe / DEVELOP.ZIP / FILEECHO.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-02-08  |  1.6 KB  |  53 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 ReadFileEchos;
  12.  
  13.   (* This procedure demonstrates how to read the FAREAS.FIX file           *)
  14.  
  15.   (* The procedures for reading the other configuration files, such as     *)
  16.   (* NODEFILE.FIX are identical to this one. For that reason they are not  *)
  17.   (* included in the developers kit                                        *)
  18.  
  19.   Var Index, Data : File;
  20.       Rec         : FileMgrRec;
  21.       Idx         : FileMgrIdx;
  22.       {$IFDEF OS2}
  23.       Nr          : LongInt;
  24.       {$ELSE}
  25.       Nr          : Word;
  26.       {$ENDIF}
  27.  
  28.   Begin
  29.     WriteLn('Reading FAREAS.FIX');
  30.  
  31.     Assign(Index, 'FAREAS.IDX');
  32.     Reset(Index, Sizeof(Idx));
  33.  
  34.     Assign(Data, 'FAREAS.FIX');
  35.     Reset(Data, Sizeof(Rec));
  36.  
  37.     Blockread(Index, Idx, 1, Nr);
  38.     While Nr > 0 Do
  39.     Begin
  40.       Seek(Data, Idx.Offset);
  41.       Blockread(Data, Rec, 1, Nr);
  42.       WriteLn(Rec.Name);
  43.       Blockread(Index, Idx, 1, Nr);
  44.     End;
  45.  
  46.     Close(Index);
  47.     Close(Data);
  48.   End;
  49.  
  50. Begin
  51.   ReadFileEchos;
  52. End.
  53.