Jump to content

Longest string challenge: Difference between revisions

m
→‎read file until not ready: changed some comments and whitespace.
m (→‎read file until not ready: elided the need to initialize the variable named M.)
m (→‎read file until not ready: changed some comments and whitespace.)
Line 1,750:
signal on notReady /*when E-O-F is reached, jump/branch. */
 
do recr=1; _=linein(iFID); w=length(_) /*read a line from the input file. */
do y=recr to 1; m=w; w=0; $=y || _; enditerate r; end /*first initialization.*/
do n=m for 1; end end /*for smaller records. */
do z=n to w for 1; $=; end end /*found longest record.*/
do x=m to w for 1; $=$'a0d'x || _; end end /*append record to $. */
m=max(m, w) /*M: is the maximum length record. */
end /*foreverr*/
 
notReady: do j=m for m /*handle the case of no input. */
Cookies help us deliver our services. By using our services, you agree to our use of cookies.