Thanks,
REXX Rookie
I managed to find a REXX IDE that has this available as a built-in template and
it's never let me down. Hope it helps you.
/*============[Bubble sort]============*/
BubSort: Procedure Expose stem.
Do i = stem.0 To 1 By -1 Until flip_flop = 1
flip_flop = 1
Do j = 2 To i
m = j - 1
If stem.m > stem.j Then Do
xchg = stem.m
stem.m = stem.j
stem.j = xchg
flip_flop = 0
End /* If stem.m ... */
End /* Do j = 2 ... */
End /* Do i = stem.0 ... */
Return ''
/*** End BubSort ***/
--
/--------------------\
| Jerry McBride |
| mcbr...@erols.com |
\--------------------/
In article <37066e22...@news.autobahn.mb.ca>, cap...@crunch.com wrote:
>Does anyone have working code for a REXX sort using the Bubble
>algorithm. I am attempting to sort a STEM with numerical values in
>descending order. Any other sort algorithms written in TSO REXX would
>be appreciated.
__________________________________
Rex Swain ; Independent Consultant
Tel: 860-868-0131 ; Fax: 860-868-9970
Mail: 8 South Street ; Washington, CT 06793 ; USA
Email: rhs...@acm.org ; Web: http://www.pcnet.com/~rhswain
Joe Hunter
cap...@crunch.com wrote:
> Does anyone have working code for a REXX sort using the Bubble
> algorithm. I am attempting to sort a STEM with numerical values in
> descending order. Any other sort algorithms written in TSO REXX would
> be appreciated.
>
> Thanks,
>
> REXX Rookie