File input/output: Difference between revisions

File input/output in various BASIC dialents (BASIC256, QBasic, True BASIC and Yabasic)
(Added Quackery.)
(File input/output in various BASIC dialents (BASIC256, QBasic, True BASIC and Yabasic))
Line 837:
SAVE text$ TO "output.txt"
</lang>
 
==={{header|BASIC256}}===
<lang freebasic>open 1, "input.txt"
open 2, "output.txt"
while not eof(1)
linea$ = readline(1)
write 2, linea$
end while
close 1
close 2</lang>
 
==={{header|Commodore BASIC}}===
Line 868 ⟶ 878:
220 CLOSE #2
230 END HANDLER</lang>
 
==={{header|QBasic}}===
<lang QBasic>OPEN "INPUT.TXT" FOR INPUT AS #1
OPEN "OUTPUT.TXT" FOR OUTPUT AS #2
DO UNTIL EOF(1)
LINE INPUT #1, DATA$
PRINT #2, DATA$
LOOP
CLOSE #1
CLOSE #2
END</lang>
 
==={{header|True BASIC}}===
<lang qbasic>OPEN #1: NAME "input.txt", ORG TEXT, ACCESS INPUT, CREATE OLD
OPEN #2: NAME "output.txt", CREATE NEWOLD
ERASE #2
DO
LINE INPUT #1: linea$
PRINT #2: linea$
LOOP UNTIL END #1
CLOSE #1
CLOSE #2
END</lang>
 
==={{header|Yabasic}}===
<lang yabasic>open "input.txt" for reading as #1
open "output.txt" for writing as #2
while not eof(1)
line input #1 linea$
print #2 linea$
wend
close #1
close #2</lang>
 
=={{header|Batch File}}==
2,136

edits