• 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: Sort items in a list without OSAXen
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sort items in a list without OSAXen


  • Subject: Re: Sort items in a list without OSAXen
  • From: Arthur J Knapp <email@hidden>
  • Date: Tue, 04 Sep 2001 09:49:05 -0400

> Date: Sun, 02 Sep 2001 14:20:25 -0400
> Subject: Re: Sort items in a list without OSAXen
> From: Arthur J Knapp <email@hidden>

I recently posted some new handlers for sorting. One of them,
SortedRefNumbers, has shown strange and inconsistent behavior,
especially with larger lists, (thanks Victor Yee). :)

The following is a fix that seems to take care of the problem:

> property kLeastNumber : -1.0E+18
> property kNotANumber : ""

> on SortedRefNumbers(refList)
> tell refList
> set beginning to kLeastNumber
> repeat with i from 3 to length
> if item i < item (i - 1) then
> set {v, item i, i} to {item i, kNotANumber, i - 2}
> repeat while v < item i
> set i to i - 1
> end repeat


> -- set contents to (items 1 thru i & v & ,
> -- items (i + 1) thru -1)'s numbers

set contents to ,
{} & (items 1 thru i & v & items (i+1) thru -1)'s numbers


> end if
> end repeat
> set contents to rest
> end tell
> end SortedRefNumbers


This problem does not seem to have affected the SortedNumbers or
SortedStrings handlers, only SortedRefStrings.

Have fun :)


Arthur J. Knapp
http://www.stellarvisions.com
mailto:email@hidden

Hey, check out:
<http://developer.apple.com/techpubs/macos8/InterproCom/AppleScriptScripters
/AppleScriptLangGuide/>


  • Prev by Date: Re: Jon's Commands
  • Next by Date: Re: Sort items in a list without OSAXen
  • Previous by thread: Re: Sort items in a list without OSAXen
  • Next by thread: Re: Sort items in a list without OSAXen
  • Index(es):
    • Date
    • Thread