Program:
100 KB = -16384: KBS = -16368
110 D$ = chr$(4)
120 home
130 input "text file name? ";file$
140 print
150 input "destination slot? ";SL
160 onerr goto 500
170 print D$;"open ";file$
180 print D$;"read ";file$
190 get A$
200 pr# SL
210 print A$;
220 if peek (KB) <> 155 then 190
230 poke KBS,0
500 pr# 0
510 call 1002
520 print
530 print D$;"close ";file$
540 end
To stop the program before the end of the file is reached, press ESCAPE.