home *** CD-ROM | disk | FTP | other *** search
- /* Organize Instruments - Ed Wiles, 20th March 1995 */
-
- address OCTAMED_REXX
- options results
-
- 'in_select lu'
- 'in_getnumber'; last = result
-
- if last = 1 then do
- 'in_isslotused'
- if result then 'wi_showstring Only one instrument in song!'
- else 'wi_showstring No instruments in song!'
- exit
- end
-
- in_select 1
- in_isslotused
-
- if result = 0 then
- emptyslot = 1
- else do
- 'in_select nextfree'
- 'in_getnumber'; emptyslot = result
-
- if (emptyslot = 1) | (emptyslot > last) then do
- 'in_select 1'
- 'wi_showstring Instruments already organized.'
- exit
- end
- end
-
- 'wi_showstring Organizing instruments...'
-
- nextfull = 2
-
- do until nextfull > last
- do while nextfull <= last
- 'in_select' nextfull
- 'in_isslotused'
-
- if result = 1 then break
-
- nextfull = nextfull + 1
- end
-
- if nextfull <= last then do
- 'in_swapinstruments' emptyslot nextfull
- 'rn_changeinum' emptyslot nextfull 'swap'
- emptyslot = emptyslot + 1
- nextfull = nextfull + 1
- end
- end
-
- 'in_select lu'
- 'in_getnumber'
- 'wi_showstring Instruments organized. Song has 'result' instruments.'
- 'in_select 1'
-