• 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? (Modified by Simon Forster)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: minimum function? (Modified by Simon Forster)


  • Subject: Re: minimum function? (Modified by Simon Forster)
  • From: Simon Forster <email@hidden>
  • Date: Wed, 6 Apr 2005 13:00:19 +0100
  • Resent-date: Wed, 6 Apr 2005 14:07:14 +0100
  • Resent-from: Simon Forster <email@hidden>
  • Resent-message-id: <email@hidden>
  • Resent-to: AppleScript Mail List <email@hidden>

Apologies to Nigel Garvey - email went direct to him rather than to the list. I forget that Apple have a policy of setting the return address to that of the original server rather than the list server - of the 10 or so lists I subscribe to, this is the only one with such a policy.

On 6 Apr 2005, at 11:39, Nigel Garvey wrote:

  on minimum(nList)
    script o
      property nl : nList
    end script

    set min to item 1 of o's nl
    repeat with i from 2 to (count nList)
      set n to item i of o's nl
      if n < min then set min to n
    end repeat

    return min
  end minimum

Why do you create a script object to hold the list of numbers? Why don't you access the list of number passed into the function directly? If it's a speed thing, can you explain a but further?


Many thanks

Simon Forster
_____________________________________________________
 LDML Ltd, 62 Pall Mall, London, SW1Y 5HZ, UK
 Tel: +44 (0)870 1999 780   Fax: +44 (0)70 9230 5247
_____________________________________________________

_______________________________________________
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: "Gary (Lists)" <email@hidden>
    • Re: minimum function? (Modified by Simon Forster)
      • From: Axel Luttgens <email@hidden>
  • Prev by Date: Re: minimum function?
  • Next by Date: Problem with Arrow keys
  • Previous by thread: Re: merge pdfs
  • Next by thread: Re: minimum function? (Modified by Simon Forster)
  • Index(es):
    • Date
    • Thread