Next highest int from digits: Difference between revisions

m
→‎{{header|REXX}}: changed whitespace, made a function more autonomous.
m (used gold section header for E.g., added whitespace, added whitespace before the TOC, corrected a misspelling.)
m (→‎{{header|REXX}}: changed whitespace, made a function more autonomous.)
Line 1,304:
<lang rexx>/*REXX program finds the next highest positive integer from a list of decimal digits. */
parse arg n /*obtain optional arguments from the CL*/
if n='' | n="," then n= 0 9 12 21 12453 738440 45072010 95322020 /*use the defaults? */
w= length( commas( word(n, words(n) ) ) ) /*maximum width number (with commas). */
 
Line 1,320:
exit /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
commas: parse arg _; do c?=length(_)-3 to 1 by -3; _= insert(',', _, c?); end; return _
/*──────────────────────────────────────────────────────────────────────────────────────*/
mask: parse arg z, $; @.= 0 /* [↓] build an unsorted digit mask. */