Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,39 @@
|
|||
read: procedure options (main); /* 18 January 2012. */
|
||||
declare line character (100) varying controlled;
|
||||
declare text character (100) varying;
|
||||
declare max_length fixed binary;
|
||||
declare in file input;
|
||||
|
||||
on endfile (in) go to done;
|
||||
|
||||
open file (in) title ('/readline.pli,type(text),recsize(100)');
|
||||
|
||||
max_length = 0;
|
||||
do forever;
|
||||
get file (in) edit (text) (L);
|
||||
put skip list (text);
|
||||
if length (text) > max_length then
|
||||
do;
|
||||
max_length = length(text);
|
||||
/* empty the stack */
|
||||
do while (allocation(line) > 0);
|
||||
free line;
|
||||
end;
|
||||
allocate line;
|
||||
line = text;
|
||||
end;
|
||||
else if length(text) = max_length then
|
||||
do;
|
||||
allocate line;
|
||||
line = text;
|
||||
end;
|
||||
end;
|
||||
|
||||
done:
|
||||
put skip list (max_length || ' is the length of the longest line(s)' );
|
||||
do while (allocation(line) > 0);
|
||||
put skip list (line);
|
||||
free line;
|
||||
end;
|
||||
|
||||
end read;
|
||||
Loading…
Add table
Add a link
Reference in a new issue