• 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: Christopher Nebel <email@hidden>
  • Date: Tue, 22 May 2007 13:36:53 -0700

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
  • Follow-Ups:
    • Re: version numbers
      • From: Chris Swain <email@hidden>
    • Re: version numbers
      • From: James Nierodzik <email@hidden>
References: 
 >version numbers (From: Chris Swain <email@hidden>)

  • Prev by Date: Re: Rookie - Import Mail mailbox
  • Next by Date: Re: version numbers
  • Previous by thread: version numbers
  • Next by thread: Re: version numbers
  • Index(es):
    • Date
    • Thread