• 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: minimum function?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: minimum function?


  • Subject: Re: minimum function?
  • From: jj <email@hidden>
  • Date: Tue, 05 Apr 2005 21:53:22 +0200

> Hi,
>
> Does anywhere exist a command for a minimum function? Where x is the
> returned smallest number of the list {a,b,c}?
>
> ex. x = min{a,b,c}
>
> Thanks,
> Jake

There is "statlist" inside Satimage osax:

#################################
minimum of (statlist {5, 4, 2, 6}) --> 2.0
#################################

http://www.satimage.fr/software/en/downloads_osaxen.html

You can also loop through the list (depending on the length of the list, it
will be faster using Satimage):

#################################
set theList to {5, 4, 2, 6}

set min to 2 ^ 512 --> very high value

repeat with i from 1 to count theList
    if theList's item i < min then set min to theList's item i
end repeat

min --> 2
#################################


jj

--
http://www.macscripter.net/
http://www.osaxen.com/


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: minimum function?
      • From: "Mark J. Reed" <email@hidden>
    • Re: minimum function?
      • From: Jake Pietrykowski <email@hidden>
References: 
 >minimum function? (From: Jake Pietrykowski <email@hidden>)

  • Prev by Date: Re: New to OS X question: scripting desktop picture
  • Next by Date: Re: minimum function?
  • Previous by thread: minimum function?
  • Next by thread: Re: minimum function?
  • Index(es):
    • Date
    • Thread