• 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: Too simple to find an answer for...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Too simple to find an answer for...


  • Subject: Re: Too simple to find an answer for...
  • From: Martin Orpen <email@hidden>
  • Date: Thu, 29 Jul 2004 23:52:18 +0100

on 29/7/04 9:33 pm, Andrew Oliver at email@hidden wrote:

> If what you're trying to do is sum (i.e. add) all the integers, you'll
> either need to loop through them, or use some OSAX that can do it for you
> (without checking, I'm guessing the Satimage OSAX will do this 0- it does
> just about everything else ;) )

That's not necessarily true:


set MyNumberList to {5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2}
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to " + "
set myResult to do shell script "echo " & (MyNumberList as string) & " |
bc"
set AppleScript's text item delimiters to oldDelims
myResult

-->"58"


It's just a bit of fun :-)

--
Martin Orpen
Idea Digital Imaging Ltd -- The Image Specialists
http://www.idea-digital.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Too simple to find an answer for...
      • From: Allen Watson <email@hidden>
References: 
 >Re: Too simple to find an answer for... (From: Andrew Oliver <email@hidden>)

  • Prev by Date: Re: Jamie Kahn Genet has sent you a 10% discount
  • Next by Date: Re: Finder broken
  • Previous by thread: Re: Too simple to find an answer for...
  • Next by thread: Re: Too simple to find an answer for...
  • Index(es):
    • Date
    • Thread