compareVersions Method

MS Office DHTML, HTML & CSS

compareVersions Method


Compares two version numbers.

Syntax

iResult = oClientCaps.compareVersions(sVersionNumber1, sVersionNumber2)

Parameters

sVersionNumber1 Required. String that specifies the first of two version numbers to compare.
sVersionNumber2 Required. String that specifies the second of two version numbers to compare.

Return Value

Returns one of the following values:

-1sVersionNumber1 is less than sVersionNumber2
0sVersionNumber1 is equal to sVersionNumber2
1sVersionNumber1 is greater than sVersionNumber2

Example

This example uses the compareVersions method to compare the version of the installed Microsoft virtual machine component with a specified version.

<HTML xmlns:IE >
<HEAD>
<STYLE>
@media all {
      IE\:clientCaps {behavior:url(#default#clientcaps)}
}
</STYLE>
</HEAD>

<BODY >
<IE:clientCaps ID="oClientCaps" /> 
:
<SCRIPT>
    sMSvmVersion = oClientCaps.getComponentVersion 
        ("{08B0E5C0-4FCB-11CF-AAA5-00401C608500}","ComponentID");
    if (0 == oClientCaps.compareVersions(sMSvmVersion, "5,0,18,1024"))
        window.alert ("Versions matched!");
</SCRIPT>
 :  
</BODY>

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
clientCaps

See Also

clientcapsInternet Link, using dhtml behaviorsInternet Link, getComponentVersion, isComponentInstalled


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.