./
mg_cmp_version.pro
includes main-level programtop source mg_cmp_version
result = mg_cmp_version(version1, version2)
 Compares two version numbers for the more updated number. Returns 0 for
 equal versions, 1 if version1 is later than version2, and -1 if
 version1 is earlier than version2. Strings such as 'alpha' and 'beta'
 may be tacked on to the end of a version, but are compared alphabetically.
Return value
-1, 0, or 1
Parameters
- version1 in required type=string
 first version number
- version2 in required type=string
 second version number
Examples
For example, 1.2 is later than 1.1.2:
  IDL> print, mg_cmp_version('1.2', '1.1.2')
         1
  IDL> print, mg_cmp_version('1.2', '1.3')
        -1
  IDL> print, mg_cmp_version('1.2', '1.2')
         0
  IDL> .run mg_cmp_version
                      1.2     1.1.2       1.1  1.1alpha   1.1beta
         1.2 >          0         1         1         1         1
       1.1.2 >         -1         0         1         1         1
         1.1 >         -1        -1         0         1         1
    1.1alpha >         -1        -1        -1         0        -1
     1.1beta >         -1        -1        -1         1         0
File attributes
| Modification date: | Mon Nov 28 16:00:43 2011 | 
| Lines: | 100 | 
| Docformat: | rst rst | 
![[attach.png]](idldoc-resources/attach.png)