Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View file

@ -1,19 +1,18 @@
sortStrings: procedure expose @. /*stemmed array is named: @. */
col=1; reverse='NO'; order='LEXICOGRAPHIC' /*set the defaults.*/
col=1; reverse='NO'; order='LEXICOGRAPHIC' /*set some defaults.*/
arg options
do j=1 for words(options); x=word(options,j)
do j=1 for words(options); x=word(options,j)
select
when datatype(x,'W') then col=x/1
when pos('=',x)==0 then order=x
otherwise parse var x nam '=' value
when datatype(x, 'W') then col=x/1
when pos('=', x)==0 then order=x
otherwise parse var x nam '=' value
end /*select*/
end /*j*/
/*check for errors here: COL isn't positive, */
/* REVERSE value isn't NO or YES, */
/* ORDER value is recognized ... */
... main body of string sort here ...
return
/*╔═══════════════════════════════════════════════════════════╗
check for errors here: COL isn't a positive integer ···,
REVERSE value isn't NO or YES,
ORDER value is recognized ···
*/
... main body of string sort here ...
return /*stick a fork in it, we're done.*/

View file

@ -1,4 +1,4 @@
/*REXX example to use the SortStrings subroutine with optional args. */
/*...define array (@.nnn) of strings here...*/
/*REXX example uses the SortStrings subroutine with optional args. */
/*···define array (@.nnn) of strings here···*/
call sortStrings 'Reverse=no' 3
/*stick a fork in it, we're done.*/