Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Save text to a file
simMode4.0 For multi-moniter
Exit Browser
Pass handler to next Sprite
Blur Range/Pendulum-Alphamania
EZIO
Buddy Saver
All_In_One Button Hue Shift
Sprite Works
ControlXtra
 

 

 

Behavior Multi lists sorting

Added on 4/4/2001

 

Compatibilities:
D7 D8 Mac PC Script Shockwave

This item has not yet been rated

Author: EmmanuelNedelec

This behavior sorts as many linear lists as you wish ordering by one of them, at your choice

-- created by Emmanuel Nedelec e.nedelec@wanadoo.fr

-- parameters :
--   ListOfLists : a list of the several lists to sort
--     it can be for example :
--     [["Martin","Dave","John"],["Smith","Johnson","McRoy"],
--      [33,45,26]]
--   orderChoice : the rank of the list to use to sort
--      to continue the example, sorting by Name would be 2,
--      by age would be 3
-- return :
--   a new list of lists sorted as you wished

on MultiSort ListofLists, orderChoice
  
  set nbList = count (ListofLists)
  set mySorList = getAt (ListofLists, orderChoice)
  set myMax = count (mySorList)
  set newList = [:]
  repeat with i = 1 to myMax
    addProp newList, mySorList [i], i
  end repeat
  sort newList
  set newListList = []
  repeat with i = 1 to nbList
    add newListList, []
  end repeat
  repeat with i = 1 to myMax
    set myPos = getAt (newList,i)
    repeat with j = 1 to nbList
      newListList[j][i] = ListofLists[j][myPos]
      updatestage
    end repeat
  end repeat
  return newListList
end
  

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail