home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / t_power / testcom.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1988-02-07  |  746 b   |  39 lines

  1. program TestCom;
  2.  
  3. uses TPDos,
  4.      TPCrt,
  5.      printer,
  6.      TpInt,
  7.      ComPort,
  8.      TpString;
  9.  
  10. var
  11.   Port,
  12.   Params: word;
  13.   S:      string;
  14.   Ch:     char;
  15.  
  16. begin
  17.  
  18.   ClrScr;
  19.   writeln;
  20.   writeln;
  21.   Port := Com1Port;
  22.   Params := Baud9600 + NoParity + WordSize8 + StopBits1;
  23.   if OpenCom( Port, Params ) then;
  24.   while not KeyPressed do begin
  25.     with Async do if Head <> Tail then begin
  26.       Ch := ReadCom;
  27.       if Ch = #$88 then begin
  28.         gotoXY( 1, 1);
  29.         writeln( Head:6, Tail:6 );
  30.         writeln;
  31.         end;
  32.       if WhereX > 46 then begin
  33.         writeln;
  34.         ClrEOL;
  35.         end;
  36.       write( HexB( byte(Ch) ), ' ' );
  37.       end;   {with ...}
  38.     end;  {while not KeyPressed}
  39.   end.