home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / RADOOR30.ZIP / DRVDEMO.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-04-10  |  2.6 KB  |  62 lines

  1. {╔═════════════════════════════════════════════════════════════════════════╗
  2.  ║                                                                         ║
  3.  ║                   (c) CopyRight LiveSystems 1990, 1994                  ║
  4.  ║                                                                         ║
  5.  ║ Author    : Gerhard Hoogterp                                            ║
  6.  ║ FidoNet   : 2:282/100.5   2:283/7.33                                    ║
  7.  ║ BitNet    : GERHARD@LOIPON.WLINK.NL                                     ║
  8.  ║                                                                         ║
  9.  ║ SnailMail : Kremersmaten 108                                            ║
  10.  ║             7511 LC Enschede                                            ║
  11.  ║             The Netherlands                                             ║
  12.  ║                                                                         ║
  13.  ║        This module is part of the RADoor BBS doorwriters toolbox.       ║
  14.  ║                                                                         ║
  15.  ╚═════════════════════════════════════════════════════════════════════════╝}
  16.  
  17. Program DriverDemo; { A ANSI/AVATAR and FileObject demo program }
  18. Uses CRT,
  19.      FileObj,
  20.      Driver;
  21.  
  22. Const MaxBuf = 1024;
  23.  
  24. Var Inp   : FileObject;                { An untyped input fileobject }
  25.     Buf   : Array[1..MaxBuf] Of Char;  { a buffer to speed things up }
  26.     Max   : Word;                      { The maximal buffer size     }
  27.     Count : Word;                      { A general counter           }
  28.  
  29.  
  30. Begin
  31. WriteLn('DriverDemo (c) LiveSystems 1990,1991   ALL RIGHTS RESERVED,  NO GUARANTEES');
  32. WriteLn('Written by G.Hoogterp. E-mail address 2:286/201.6 Last Revision 3 Aug 91');
  33. WriteLn;
  34. ClrScr;
  35. If ParamCount=0
  36.    Then Begin
  37.         WriteLn('Usage : DRVDEMO <Filename>');
  38.         WriteLn;
  39.         WriteLn('        Where Filename is an ANS/AVT file or has mixed');
  40.         WriteLn('        contents.');
  41.         Halt;
  42.         End;
  43.  
  44. Max:=MaxBuf;   { Set max to the maximal BufferSize }
  45.  
  46. Inp.Open(ParamStr(1),1,ReadOnly+ShareDenyNone);
  47. If Inp.Error<>0
  48.    Then Begin
  49.         WriteLn('Error opening file '+ParamStr(1));
  50.         Halt;
  51.         End;
  52.  
  53. While not Inp.Eof Do  { While the end of file isn't there, }
  54.  Begin
  55.  Inp.ReadBuffer(Buf,Max);  { Fill the buffer with input. Max returnes the   }
  56.  For Count:=1 To Max Do    { number of bytes read.                          }
  57.    ScreenDriver(Buf[Count]);
  58.  End;
  59. Inp.Close;                 { Close the fileobject                           }
  60. End.
  61.  
  62.