Previous Topic: GetFileInfoNext Topic: Icon Functions


CompareVersions

The CompareVersions function compares two file versions and returns whether they are identical. This function has the following format:

CompareVersions (version1 as string, version2 as string)  as integer

Example: CompareVersions

CompareVersions ("12.5.1.4", "12.5.0.3")

Input Parameters

This function has the following input parameters:

version1 and version2

Specifies the versions of the file you want to compare. You can specify any number of version identification items in the version string. For example, you can specify the version string using the major.minor.patch.build format or just the major.minor format. The version numbers can be separated by dots, spaces, or commas. If one version string has more identification items than the other version string, the missing items are replaced with zero at the time of comparison. For example, CompareVersions ("12.5.180.123", "12.5") is treated as CompareVersions ("12.5.180.123", "12.5.0.0").

Return Values

The function returns one of the following predefined integer constants:

ECVEQUAL (0)

Indicates that the versions are equal.

ECVGREATERTHAN (1)

Indicates that version 1 is greater than version 2.

ECVLESSTHAN (-1)

Indicates that version 1 is lower than version 2.

ECVINVALID (2)

Indicates that one or both of the version strings is blank or contains a non-numeric value.