home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / opus / opin103d.lzh / D_COM1.PAS next >
Pascal/Delphi Source File  |  1989-12-03  |  3KB  |  71 lines

  1. Program Demo_Com1;
  2.  
  3.   {***************************************************************************}
  4.   {*                                                                         *}
  5.   {* O p u s   I n t e r f a c e    V e r   1.03     Demo Program.           *}
  6.   {*                                                                         *}
  7.   {*   Opus V 1.0x Interface for Turbo Pascal Ver 4.0, 5.0 and 5.5           *}
  8.   {*                                                                         *}
  9.   {*  These Structures,Procedures and Functions may help you to make OPUS    *}
  10.   {* utilities for to help other SysOps, Please read the Documentation.      *}
  11.   {*                                                                         *}
  12.   {*  Regards                                                                *}
  13.   {*    Per Holm                                                             *}
  14.   {*                                                                         *}
  15.   {*   FIDO: Per Holm - Asgaard BBS 2:230/22.0                               *}
  16.   {*   UUCP: perholm@daimi.DK                                                *}
  17.   {*                                                                         *}
  18.   {***************************************************************************}
  19.  
  20.  
  21.   {***************************************************************************}
  22.   {*                                                                         *}
  23.   {*  Demo of the level 3 communication routines...                          *}
  24.   {*                                                                         *}
  25.   {***************************************************************************}
  26.  
  27. Uses
  28.   OPINT;
  29.  
  30. VAR
  31.   c:char;
  32.   i: Integer;
  33.   ComIn,ComOut: Text;
  34.   Line: String[80];
  35.  
  36. PROCEDURE IOCheck;
  37.  
  38.   BEGIN
  39.     IF IOResult>0 THEN
  40.       BEGIN
  41.         Writeln('IOError');
  42.         Halt;
  43.       END;
  44.   END;
  45.  
  46. BEGIN
  47.   _Snoop:=_On;                                 { Look at this...              }
  48.   _KeyBoard:=_On;                              { Enable Keyboard              }
  49.   _ExitCarrier:=0;                             { Don't exit on Carrier change }
  50.   AssignFossil(ComIn,0,0);                     { Assign for input Don;t       }
  51.   Reset(ComIn);                                { change BaudRate              }
  52.   IOCheck;
  53.   AssignFossil(ComOut,0,0);                    { Here's a device to write to  }
  54.   rewrite(ComOut);
  55.   IOCheck;
  56.   WriteLn(ComOut,'Hi Johnny, Enter a line of text');
  57.   IOCheck;
  58.   Readln(ComIn,Line);
  59.   IOCheck;
  60.   Writeln(ComOut,'OK here we go : "',Line,'"');
  61.   IOCheck;
  62.   IF FossilCarrier(ComIn) THEN
  63.     Writeln('Carrier OK');
  64.   write(ComOut,'Thanx Press Enter');
  65.   IOCheck;
  66.   repeat
  67.   until ReadFossil(ComIn)=#13;
  68.   writeln(ComOut);
  69.   IOCheck;
  70. END.
  71.