10 REM > GETchn - Test GET$#n 20 : 30 PRINT"Test GET$#chn edge cases" 40 M%=0:ON ERROR M%=255 50 IF M%=00:M%=LENSTRING$(65535,"*") 60 ON ERROR OFF 70 : 80 PRINT '"Terminated with EOF" 90 FOR N%=M%-2 TO M% 100 F%=OPENOUT"TEMP" 110 BPUT#F%,STRING$(N%,"A"); 120 CLOSE #F% 130 F%=OPENIN"TEMP" 140 A$=GET$#F% 150 CLOSE #F% 160 PRINT "Write: 1x";N%;" Read: ";LENA$;" ";FNok(N%=LENA$) 170 NEXT N% 180 : 190 PRINT '"Terminated with EOL" 200 FOR N%=M%-2 TO M% 210 F%=OPENOUT"TEMP" 220 BPUT#F%,STRING$(N%,"A") 230 BPUT#F%,STRING$(N%,"B") 240 CLOSE #F% 250 F%=OPENIN"TEMP" 260 A$=GET$#F% 270 B$=GET$#F% 280 CLOSE #F% 290 PRINT "Write: 2x";N%;" Read: ";LENA$;",";LENB$;" ";FNok(N%=LENA$ AND N%=LENB$) 300 NEXT N% 310 : 320 PRINT '"Unterminated" 330 FOR N%=M%-2 TO M% 340 F%=OPENOUT"TEMP" 350 BPUT#F%,STRING$(N%,"A"); 360 BPUT#F%,STRING$(N%,"B"); 370 CLOSE #F% 380 F%=OPENIN"TEMP" 390 A$=GET$#F% 400 B$=GET$#F% 410 CLOSE #F% 420 PRINT "Write: 2x";N%;" Read: ";LENA$;",";LENB$;" Implementation specific" 430 NEXT N% 440 *DELETE TEMP 450 END 460 : 470 DEFFNok(A%):IF A%:="OK" ELSE ="FAILED"