home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Garbo
/
Garbo.cdr
/
pc
/
opus
/
opin103d.lzh
/
DEMO_COM.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1989-12-03
|
4KB
|
102 lines
Program Demo_Com;
{***************************************************************************}
{* *}
{* O p u s I n t e r f a c e V e r 1.03 Demo Program. *}
{* *}
{* Opus V 1.0x Interface for Turbo Pascal Ver 4.0, 5.0 and 5.5 *}
{* *}
{* These Structures,Procedures and Functions may help you to make OPUS *}
{* utilities for to help other SysOps, Please read the Documentation. *}
{* *}
{* Regards *}
{* Per Holm *}
{* *}
{* FIDO: Per Holm - Asgaard BBS 2:230/22.0 *}
{* UUCP: perholm@daimi.DK *}
{* *}
{***************************************************************************}
{***************************************************************************}
{* *}
{* Demo of some level 1 and 2 level communications routines.. *}
{* *}
{***************************************************************************}
{$I-}
Uses OPINT,Crt,Dos;
VAR
c:char;
i: Integer;
ComIn,ComOut: Text;
Line: String[80];
BEGIN
_Snoop:=_On; { Look at this... }
_KeyBoard:=_On; { Enable Keyboard }
_ExitCarrier:=0; { Don't exit on Carrier change }
AssignFossil(ComIn,0,0); { Assign for input Don;t }
i:=OpIntError;
IF (i<>0) and (i<>191) THEN
BEGIN
writeln(#7,'Error initialising the FOSSIL');
Halt(9);
END;
IF i=191 THEN
SetDtrFossil(ComIn,_Off);
Reset(ComIn); { change BaudRate }
IF IOResult<>0 THEN
BEGIN
writeln(#7,'Error initialising the FOSSIL');
Halt(9);
END;
AssignFossil(ComOut,0,0); { Here's a device to write to }
i:=OpIntError;
IF (i<>0) and (i<>191) THEN
BEGIN
i:=OpIntError;
writeln(#7,'Error initialising the FOSSIL');
Halt(9);
END;
IF i=191 THEN
SetDtrFossil(ComOut,_Off);
SetAnsiFossil(ComOut,(Usr.Flags AND Usr_Ansi>0));
rewrite(ComOut);
IF IOResult<>0 THEN
BEGIN
writeln(#7,'Error initialising the FOSSIL');
Halt(9);
END;
WriteLn(ComOut,'Hi Johnny, Enter a line of text');
Readln(ComIn,Line);
IF IOResult<>0 THEN
BEGIN
writeln(#7,'Error reading from the FOSSIL');
Halt(9);
END;
Writeln(ComOut,'OK here we go : "',Line,'"');
IF IOResult<>0 THEN
BEGIN
writeln(#7,'Error writing to the FOSSIL');
Halt(9);
END;
IF FossilCarrier(ComIn) THEN
Writeln('Carrier OK');
write(ComOut,'Thanx Press Enter');
IF IOResult<>0 THEN
BEGIN
writeln(#7,'Error writing to the FOSSIL');
Halt(9);
END;
repeat
until ReadFossil(ComIn)=#13;
writeln(ComOut);
IF IOResult<>0 THEN
BEGIN
writeln(#7,'Error writing to the FOSSIL');
Halt(9);
END;
END.