Anonymous user
Longest string challenge: Difference between revisions
m
→read file until not ready: elided the need for the variable named ONE.
m (→read file until not ready: added a colon to a template text.) |
m (→read file until not ready: elided the need for the variable named ONE.) |
||
Line 1,745:
<br>no arrays or lists are used, and
<br>no additions or subtractions are used.
<lang rexx>/*REXX program reads a file and displays the longest [widest] record(s) [line(s)].
parse arg iFID . /*obtain optional argument from the CL.*/
if iFID=='' | iFID=="," then iFID= 'LONGEST.TXT' /*Not specified? Then use the default.*/
signal on notReady /*when E-O-F is reached, jump/branch. */
m=0 /*the maximum width (so far). */
do
do
do
do
m=max(m, w) /*M: is the maximum length record. */
end /*forever*/
|