MGunit documentation

Unit testing for IDL

single page | use frames     summary     class     fields     routine details     file attributes

dist_tools/

mg_cmp_version.pro

topmg_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 less 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

File attributes

Modification date: Wed Apr 22 23:29:01 2009
Lines: 60
Docformat: rst rst