• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: wanted a real sort
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wanted a real sort


  • Subject: Re: wanted a real sort
  • From: Yosemite <email@hidden>
  • Date: Tue, 10 Apr 2001 15:49:57 -0800

-- try this

set unsortedList to {120, 1, 119, 2, 100, 4, 100, 9}
repeat with i from 1 to ((number of items in unsortedList) - 1)
set iis to item i in unsortedList
repeat with j from (i + 1) to number of items in unsortedList
if (item i in unsortedList) > (item (j) in unsortedList) then
set temp to item i in unsortedList
set item i in unsortedList to item j in unsortedList
set item j in unsortedList to temp
end if
end repeat
set s to 1
end repeat

-- yeilds smallest to largest, to reverse change the '>' to '<' in
-- the fifth line


-- hcir
mailto:email@hidden


> does anyone know how to place a list into order? ; 1,2,3 not 1,10,11...


References: 
 >wanted a real sort (From: email@hidden)

  • Prev by Date: Problems with URL access
  • Next by Date: Re: «event XUVJdtdl» Error
  • Previous by thread: wanted a real sort
  • Next by thread: Re: wanted a real sort
  • Index(es):
    • Date
    • Thread