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
getSystemTime
PDF export: text and vector shapes
Frogger by J.R.D.R.
Russian site
Hybrid CD
INSIDE Macromedia Director & Lingo
ProjectorLook Xtra
RearWindow Professional
Atom
Simple Paint application
 

 

 

Behavior Sortem

Added on 5/23/2001

 

Compatibilities:
behavior D7 D8 D8_5 Mac PC Shockwave

This item has not yet been rated

Author: KurtKoenig (website)

SORT OUT -- Use repeatloops to sort the numbers (or letters) in a field. Kurt * Belgium 05/15/2001

Download PC Source
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------
--   SORT OUT
--
--   Use repeatloops to sort the numbers (or letters)
--   in a field.
--  
--
--   Kurt * Belgium     05/15/2001
--
---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------


on mouseup me
  -- the number of characters to sort
  AMOUNT = (member "Input").chars.count
  --The number of times the loop will be repeated = COUNTER
  COUNTER = 1
  -- The number of times compared to the number of characters
  repeat while COUNTER <= AMOUNT
    -- The position of an element
    POS = 1
    REMAIN = AMOUNT - COUNTER
    repeat while POS <= REMAIN
      --if an element is bigger than the next element, it is placed in a
      --helpvariable,then the position of the two elements is switched.
      if (member "Input").char[POS] > (member "Input").char[POS + 1] then
        HELP = (member "Input").char[POS]
        (member "Input").char[POS] = (member "Input").char[POS + 1]
        (member "Input").char[POS + 1] = HELP
      end if
      POS = POS + 1
    end repeat
    COUNTER = (COUNTER + 1)
  end repeat
end



 


Contact

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

Send e-mail