Input loop: Difference between revisions

(Opening command channel needs to be taken out of loop to avoid "?File Already Open" errors. Also initialize F$ each time, as null input results in F$ retaining last used value.)
Line 489:
200 IF PEEK(222) <> 5 THEN RESUME
210 PRINT D$"CLOSE"F$</lang>
 
==={{header|BaCon}}===
 
<lang freebasic>
'--- some generic header file to give it a real test
PRINT "Enter any file name you want to read ex: /usr/include/X11/X.h"
INPUT filename$
 
text$ = LOAD$(filename$)
SPLIT text$ BY NL$ TO TOK$ SIZE dim
i = 0
 
'---dynamic index the end of an array is always null terminated
WHILE (TOK$[i] ISNOT NULL)
PRINT TOK$[i]
INCR i
WEND
</lang>
 
==={{header|BBC BASIC}}===
69

edits