|
|
Make an AppleScript Studio application self-update
Comparing version strings won't always work if your version numbers include bug fix numbers (the 3rd number in "a.b.c"). One example of where comparing version strings fails is:
But in that case, "10" is not a "normal" bug fix number, since it exceeds the 0-9 range. To compare versions correctly, you need to convert them into BCD (binary-coded decimal) or compare the version parts individually, e.g.:
Of course, this doesn't handle the case where you have letters and build numbers at the end, like 1.0.2b14.
Make an AppleScript Studio application self-update
Actually, "10.0 < 2.0" also fails, and 10.0 is a completely valid version number.
Make an AppleScript Studio application self-update
Mac OS X 10.4 added "considering numeric strings" so that version strings will compare correctly ("10.6.2" < "10.6.10"). |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.14 seconds |
|