• 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: version numbers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: version numbers


  • Subject: Re: version numbers
  • From: Chris Swain <email@hidden>
  • Date: Tue, 22 May 2007 22:51:17 +0100

Brilliant!

Many Thanks

Chris
On 22 May 2007, at 21:36, Christopher Nebel wrote:

On May 21, 2007, at 11:14 AM, Chris Swain wrote:

I have an applescript studio application that requires particular versions of a series of command-line programmes. I use do shell script to find the version number (it is usually something like 2.14.10) and I need to check it is > 2.1.
I was going to break the version number down using the "." as a delimiter and compare each part of the number, but I wondered if anyone had something simpler?

If you can assume you're running on Tiger or later, you could use "considering numeric strings", since that's exactly the problem it was designed to solve. For example:


"2.14.10" > "2.2" --> false, as per standard dictionary ordering.
considering numeric strings
"2.14.10" > "2.2" --> true, if you consider each numeric string to be a single "character".
end considering



--Chris Nebel AppleScript Engineering


_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >version numbers (From: Chris Swain <email@hidden>)
 >Re: version numbers (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Re: version numbers
  • Next by Date: Re: Rookie - Import Mail mailbox
  • Previous by thread: Re: version numbers
  • Next by thread: with timeout / try & on error
  • Index(es):
    • Date
    • Thread