home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 September / PCO_0998.ISO / filesbbs / dos / afx_511.exe / DEVELOP.ZIP / STATFILE.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-02-08  |  1.7 KB  |  61 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 ReadStatFile;
  12.  
  13.   (* This procedure demonstrates how to read the STATFILE.FIX file *)
  14.  
  15.   Var Index, Data : file;
  16.       Cnt         : word;
  17.       {$IFDEF OS2}
  18.       Nr          : longint;
  19.       {$ELSE}
  20.       Nr          : word;
  21.       {$ENDIF}
  22.       Rec         : StatisticRecord;
  23.       Idx         : StatisticIndex;
  24.       Node        : NetAddress;
  25.  
  26.   Begin
  27.     WriteLn('Reading STATFILE.FIX');
  28.  
  29.     Assign(Index, 'STATFILE.IDX');
  30.     Reset(Index, Sizeof(Idx));
  31.  
  32.     Assign(Data, 'STATFILE.FIX');
  33.     Reset(Data, 1);
  34.  
  35.     Blockread(Index, Idx, 1, Nr);
  36.     While Nr > 0 Do
  37.     Begin
  38.       Seek(Data, Idx.Offset);
  39.       Blockread(Data, Rec, Sizeof(Rec), Nr);
  40.  
  41.       WriteLn('File echo : ', Rec.FileEcho);
  42.       WriteLn('File name : ', Rec.FileName);
  43.       WriteLn('Downlinks : ');
  44.  
  45.       For Cnt := 1 to Rec.NumDown Do
  46.       Begin
  47.         Blockread(Data, Node, Sizeof(Node), Nr);
  48.         WriteLn('            ', Node.Zone,':', Node.Net, '\', Node.Node, '.', Node.Point);
  49.       End;
  50.  
  51.       Blockread(Index, Idx, 1, Nr);
  52.     End;
  53.  
  54.     Close(Index);
  55.     Close(Data);
  56.   End;
  57.  
  58. Begin
  59.   ReadStatFile;
  60. End.
  61.