home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / communic / osio / mytest.pas next >
Encoding:
Pascal/Delphi Source File  |  1991-03-05  |  1.0 KB  |  39 lines

  1. Program Test_My_Interrupts;
  2.  
  3. {This program was designed to test the installation and operation of the
  4.  interrupt driver OSIO.TPU.  It requries Turbo Pascal 6.0 for operation
  5.  Copyright <C> 1991, Ryan S. Dancey}
  6.  
  7. USES CRT, DOS, OSIO;
  8.  
  9. var
  10.  SerialIO : Serial_IO;  {The Serial Object}
  11.  Garbage : Boolean;     {Variable to hold open and close results}
  12.  Ch, InCh : Char;       {Character variables for I/O}
  13.  
  14. begin
  15.  ClrScr;
  16.  with SerialIO do
  17.   begin
  18.    Garbage := Open_Port(2,300,8,1,'N');  {Open port at 300 baud, 8 bits, 1 stop bit, no parity}
  19.    writeln(Garbage);
  20.    repeat
  21.     if KeyPressed then
  22.      begin
  23.       Ch := ReadKey;
  24.       repeat until Send_Character(2,Ch);
  25.      end;
  26.     if Query_Buffer(2) then             {If this value is greater than 1, than a character has been recevied}
  27.      begin
  28.       if Get_Character(2,InCh) then
  29.        begin
  30.         write(InCh);
  31.        end;
  32.      end;
  33.     until Ch = chr(3);
  34.    Garbage := Close_Port(2);
  35.    writeln(Garbage);
  36.    repeat until KeyPressed;
  37.    Ch := ReadKey;
  38.   end;
  39. end.