Write entire file: Difference between revisions
Content added Content deleted
(added Tcl) |
m (→{{header|REXX}}: added a 2nd REXX version.) |
||
Line 61: | Line 61: | ||
=={{header|REXX}}== |
=={{header|REXX}}== |
||
===version 1=== |
|||
<lang rexx>of='file.txt' |
<lang rexx>of='file.txt' |
||
'erase' of |
'erase' of |
||
Line 69: | Line 70: | ||
{{out}} |
{{out}} |
||
<pre>100000 100000</pre> |
<pre>100000 100000</pre> |
||
===version 2=== |
|||
This REXX version doesn't depend on any (operating system) host commands. |
|||
<lang rexx>/*REXX program writes an entire file with a single write (a long text record).*/ |
|||
oFID= 'OUTPUT.DAT' /*name of the output file to be used. */ |
|||
/* [↓] 50 bytes, including the fences.*/ |
|||
$ = '<<<This is the text that is written to a file. >>>' |
|||
/* [↓] COPIES creates a 50k byte str.*/ |
|||
call charout oFID, copies($,1000), 1 /*write the longish text to the file. */ |
|||
/* [↑] the "1" writes text ──► rec #1*/ |
|||
/*stick a fork in it, we're all done. */</lang> |
|||
<br><br> |
|||
=={{header|Tcl}}== |
=={{header|Tcl}}== |