Longest string challenge: Difference between revisions

m
→‎{{header|REXX}}: elided the need for an EXIT statement within the last DO loop.
(→‎read file until not ready: re-worked REXX program to NOT use a variable to hold the length of a record or the maximum record, elided the use of an IF statement..)
m (→‎{{header|REXX}}: elided the need for an EXIT statement within the last DO loop.)
Line 1,789:
iFID= 'LONGEST.TXT' /*the default file identifier for input*/
parse arg fid . /*obtain optional argument from the CL.*/
do #=1 to length(fid); iFID=fid; leave /*ifSpecified? specified, then Then use what's given. */
end /*#*/
!= /*the maximum width (so far). */
Line 1,801:
end /*forever*/
/* [↓] comes here when file gets E─O─F*/
notReady: do j=length(!) to length(!) for length(!) /*handle the case of no input. */
say substr($, 2) /*display (all) the longest records. */
end exit /*j*/ /*stick a fork in it, we're all done. */</lang>
end /*j*/</lang>
{{out|input|text=file &nbsp; '''LONGEST.TXT''':}}
<pre>