TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Steven Hendriks
from: David Muir
date: 1995-08-05 06:30:44
subject: Serial I/O {4 of 10}

tchar:char;
BEGIN
   writechar := false;
   ret := 0;
   if not pending then BEGIN
      sendcharnow(fchar);
      ret := 1;
      end
   else BEGIN
      for e := 1 to Retries do BEGIN
         if TX_free>0 then doswrite(Fport,fchar,1,ret);
         if ret>0 then BEGIN
            e := Retries;
            writechar := True;
            end;
         end;
      end;
   if ((ret>0) and (not(LocalEcho))) then repeat
      tchar := #0;
      DOSREAD(Fport,tchar,1,ret);
      if ((tcharfchar) and (ret>0)) then BEGIN
         handlechar(tchar);
         tchar := #0;
         end;
      until ((ret=0) or (tchar=fchar));
   end;

Function ReadChar(Var fchar : char): Boolean;
VAR
   ret:longint;
BEGIN
   ret := 0;
   if Waiting then DOSREAD(Fport,fchar,1,ret);
   ReadChar := ret0;
   end;

Procedure ReadBlock(Var buf; toread:longint; Var numb_read:longint);
BEGIN
   DOSREAD(Fport,buf,toread,numb_read);
   end;

(*
Procedure WriteBLOCK(Var buf; Var towrite:longint; Var numb_writ:longint);
           Note that writeblock has been commented out because the method
           used is EXTREMELY prone to inaccuracies and loss of characters.
           Use "Writestring" instead.
BEGIN
   doswrite(Fport,buf,towrite,numb_writ);
   end;
*)

Procedure WriteString(to_write:string);
VAR
   i:byte;
BEGIN
   for i := 1 to length(to_write) do writechar(to_write[i]);
   end;

Function Carrier : Boolean;
VAR
   tptr:pointer;
   status:byte;
   retlength:longint;
BEGIN
   tptr := nil;
   DosDevIOCtl(Fport,1,$67,tptr,1,retlength,{at}status,1,retlength);
   Carrier := status and 128 =128;
   end;

Function Isring : Boolean;
VAR
   tptr:pointer;
   status:byte;
   retlength:longint;
BEGIN
   tptr := nil;
   DosDevIOCtl(Fport,1,$67,tptr,1,retlength,{at}status,1,retlength);
   isring  := status and 64 = 64;
   end;

Function DSRActive : Boolean;
VAR
   tptr:pointer;
   status:byte;
   retlength:longint;
BEGIN
   tptr := nil;
   DosDevIOCtl(Fport,1,$67,tptr,1,retlength,{at}status,1,retlength);
   DSRActive := status and 32 = 32;
   end;

Function CTSActive : Boolean;
VAR
   tptr:pointer;
   status:byte;
   retlength:longint;
BEGIN
   tptr := nil;
___ Blue Wave/QWK v2.12
--- Renegade v10-05 Exp

* Origin: Scrawled From the Tomb..(416-255-2164) (1:250/346)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 515 628 704 713/888 800/1 7877/2809
@PATH: 250/346 426 702 3615/50 396/1 270/101 105/103 42 712/515 711/808
@PATH: 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.