perm filename TEST.SAI[USE,CSR]1 blob sn#238555 filedate 1976-09-27 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	begin comment test ETV on PTY
C00005 ENDMK
C⊗;
begin comment test ETV on PTY;
integer i,pl;
string st,ch;
DEFINE PTJOBX = "PTYUUO '16,";
BOOLEAN SIMPLE PROCEDURE INSKIP(INTEGER PTYNUM);
    COMMENT Returns -1 if PTY is waiting for input (0 otherwise);
  START_CODE
    MOVE 1,PTYNUM;
    MOVEI 2,6;		COMMENT Code for IWAITS;
    PTJOBX 1;		COMMENT Skip if PTY output waiting;
      TDZA 1,1;		COMMENT   Zero AC if non-skip return;
        MOVEI 1,-1;	COMMENT     Set AC to -1 if skip return;
   END;
procedure flush;
begin string ch,st;
st←"";
do begin st←st&ptyall(pl);
call(1,"SLEEP");
end until inskip(pl);
while length(st)>0 do
begin ch←lop(st);
if ch='15 then outstr("<cr>")
else if ch='12 then outstr("<lf>")
else if ch<'30 or ch>'174 then outstr("∩"&ch)
else outchr(ch);
end;
outstr("<end>"&'15&'12);
end;
setbreak(1,"|",null,"IS");
pl←ptyget;
outstr(cvos(pl)&'15&'12);
ptostr(pl,"l use.csr"&'15&'12);
i←'4226000000; ptystl(pl,i);
while true do
begin flush;
outstr('15&'12&"ctl part:");
st←ttyin(1,i);
while length(st)>0 do
begin ch←lop(st);ptochw(pl,ch+'200);
end;
outstr('15&'12&"nml part:");
st←ttyin(1,i);
while length(st)>0 do
begin ch←lop(st);ptochw(pl,ch);
end;
outstr('15&'12&"cmt part:");
st←ttyin(1,i);
while length(st)>0 do
begin ch←lop(st);ptochw(pl,ch+'600);
end;
end;
end;