Created
July 13, 2016 23:47
-
-
Save SmugZombie/94cacbcf2720bb8453b73e07fd2e302e to your computer and use it in GitHub Desktop.
Compares Two Versions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| VersionCompare(version1, version2) | |
| { | |
| StringSplit, verA, version1, . | |
| StringSplit, verB, version2, . | |
| Loop, % (verA0> verB0 ? verA0 : verB0) | |
| { | |
| if (verA0 < A_Index) | |
| verA%A_Index% := "0" | |
| if (verB0 < A_Index) | |
| verB%A_Index% := "0" | |
| if (verA%A_Index% > verB%A_Index%) | |
| return 1 | |
| if (verB%A_Index% > verA%A_Index%) | |
| return 2 | |
| } | |
| return 0 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment