1 SUB VISIN (S$, NO%, WAIT%) 2 ! will read characters from the visual 500 with VISIN1 subroutine 3 ! WAIT% is number of 10-second units to wait for a character before 4 ! timing out. WAIT%=0% means never time out: just keep waiting. 5 ! trys to read NO% characters from visual 500. 6 ! returns if that many characters read or if timeout. 7 ! S$ returns ONLY characters read so check LEN(S$) to see if timed out. 8 ! if LEN(S$) has got less, then a timeout occured. 10 COMMON (VIS500) VIS5LUN%, QIOW$=2%, ERR$=4%, VIS5EFN%, ERRADR%, CHARMASK$=32%, CMADR% 110 S$ = "" 120 IF NO%<=0% THEN SUBEXIT 130 FOR GOT% = 1% TO NO% 140 CALL VISIN1 (WAIT%) 150 D1% = ASCII(SEG$(ERR$,1%,1%)) 160 D2% = ASCII(SEG$(ERR$,2%,2%)) 170 IF D1% = 2% THEN 300 180 IF D1% = 1% THEN S$ = S$ + CHR$(D2%) 190 NEXT GOT% 300 SUBEND