File input/output: Difference between revisions

m
→‎{{header|REXX}}: change some of the section header comments.
(added language octave)
m (→‎{{header|REXX}}: change some of the section header comments.)
Line 2,099:
 
=={{header|REXX}}==
In rexxREXX, filename association is used rather than numeric stream numbers and explicit file opening is not required.
 
===Versionversion 1===
In rexx, filename association is used rather than numeric stream numbers and explicit file opening is not required.
 
===Version 1===
<lang rexx>/*REXX program to read a file and store the contents into an output file*/
 
ifid = 'input.txt' /*name of the input file. */
ofid = 'output.txt' /*name of the output file. */
Line 2,114 ⟶ 2,112:
end
/*stick a fork in it, we're done.*/</lang>
===Versionversion 2===
/*(sameSame as the 1st example, but is faster because there's no intermediate stepassigning of a REXX variable.)*/
<lang rexx>/*REXX program to read a file and store the contents into an output file*/
/*(same as the 1st example, but is faster because no intermediate step.)*/
 
ifid = 'input.txt' /*name of the input file. */
ofid = 'output.txt' /*name of the output file. */
Line 2,126 ⟶ 2,123:
end /*while*/
/*stick a fork in it, we're done.*/</lang>
===Versionversion 3===
 
===Version 3===
Note that this version is limited to files less than one million bytes (and/or possibly virtual memory).
<lang rexx>/*REXX program to read a file and write contents to an output file*****