File input/output: Difference between revisions

Content added Content deleted
(Dialects of BASIC moved to the BASIC section.)
(→‎{{header|BASIC}}: Clarified implementation of BASIC: QuickBASIC.)
Line 793: Line 793:


=={{header|BASIC}}==
=={{header|BASIC}}==
{{works with|QuickBasic|4.5}}
<syntaxhighlight 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
SYSTEM</syntaxhighlight>

==={{header|Applesoft BASIC}}===
==={{header|Applesoft BASIC}}===
This is only meant to copy a sequential text file. It is very unlikely that this works copying a random access text file.
This is only meant to copy a sequential text file. It is very unlikely that this works copying a random access text file.
Line 1,037: Line 1,026:


==={{header|QBasic}}===
==={{header|QBasic}}===
See [[#QuickBASIC|QuickBASIC]].
<syntaxhighlight lang="qbasic">OPEN "INPUT.TXT" FOR INPUT AS #1

==={{header|QuickBASIC}}===
{{works with|QuickBasic|4.5}}
{{works with|QBasic}}
<syntaxhighlight lang="qbasic">
' File input/output
OPEN "INPUT.TXT" FOR INPUT AS #1
OPEN "OUTPUT.TXT" FOR OUTPUT AS #2
OPEN "OUTPUT.TXT" FOR OUTPUT AS #2
DO UNTIL EOF(1)
DO UNTIL EOF(1)
LINE INPUT #1, DATA$
LINE INPUT #1, Data$
PRINT #2, DATA$
PRINT #2, Data$
LOOP
LOOP
CLOSE #1
CLOSE #1
CLOSE #2
CLOSE #2
END
END</syntaxhighlight>
</syntaxhighlight>


==={{header|RapidQ}}===
==={{header|RapidQ}}===