{$ifdef testingdevices} Procedure devicedone (VAR t:textrec; m:mstr); VAR r:registers; cnt:integer; begin write (usr,'Device '); cnt:=0; while t.name[cnt]<>#0 do begin write (usr,t.name[cnt]); cnt:=cnt+1 end; writeln (usr,' ',m,'... press any key'); r.ax:=0; intr ($16,r); if r.al=3 then halt end; {$endif} {$F+} Function opendevice; begin {$ifdef testingdevices} devicedone (t,'opened'); {$endif} t.handle:=1; t.mode:=fminout; t.bufend:=0; t.bufpos:=0; opendevice:=0 end; Function closedevice; begin {$ifdef testingdevices} devicedone (t,'closed'); {$endif} t.handle:=0; t.mode:=fmclosed; t.bufend:=0; t.bufpos:=0; closedevice:=0 end; Function cleardevice; begin {$ifdef testingdevices} devicedone (t,'cleared'); {$endif} t.bufend:=0; t.bufpos:=0; cleardevice:=0 end; Function ignorecommand; begin {$ifdef testingdevices} devicedone (t,'ignored'); {$endif} ignorecommand:=0 end; Function directoutchars; VAR cnt:integer; begin for cnt:=t.bufend to t.bufpos-1 do directoutchar (t.bufptr^[cnt]); t.bufend:=0; t.bufpos:=0; directoutchars:=0 end; Function writechars; VAR cnt:integer; begin for cnt:=t.bufend to t.bufpos-1 do writechar (t.bufptr^[cnt]); t.bufend:=0; t.bufpos:=0; writechars:=0 end; Function directinchars; begin with t do begin bufptr^[0]:=waitforchar; t.bufpos:=0; t.bufend:=1 end; directinchars:=0 end; Function readcharfunc; begin with t do begin bufptr^[0]:=getinputchar; t.bufpos:=0; t.bufend:=1 end; readcharfunc:=0 end; {$F-}