Jump to content

Write entire file: Difference between revisions

Write entire file in various BASIC dialents
No edit summary
(Write entire file in various BASIC dialents)
Line 180:
Binary:
<lang freebasic>BSAVE mem TO filename$ SIZE n</lang>
 
=={{header|BASIC}}==
==={{header|BASIC256}}===
<lang freebasic>f = freefile
open f, "output.txt"
write f, "This string is to be written to the file"
close f</lang>
 
==={{header|QBasic}}===
{{works with|FreeBASIC}}
<lang QBasic>f = FREEFILE
OPEN "output.txt" FOR OUTPUT AS #f
PRINT #f, "This string is to be written to the file"
CLOSE #</lang>
 
==={{header|Run BASIC}}===
{{works with|QBasic}}
{{works with|FreeBASIC}}
<lang runbasic>open "output.txt" for output as #1
print #1, "This string is to be written to the file"
close #1</lang>
 
==={{header|True BASIC}}===
<lang qbasic>OPEN #1: NAME "output.txt", CREATE NEWOLD
PRINT #1: "This string is to be written to the file"
CLOSE #1
END</lang>
 
=={{header|BBC BASIC}}==
2,169

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.