IBM Prerequisite Scanner User Manual page 66

Table of Contents

Advertisement

end function
56
Prerequisite Scanner: User's Guide
if (i<=ubound(ver1Parts)) Then
on error resume next
v1 = Int(ver1Parts(i))
if not Err=0 Then
v1Str = ver1Parts(i)
if (i<=ubound(ver2Parts)) Then
v2Str = ver2Parts(i)
else
v2Str = "0"
end if
end if
else
v1 = 0
end if
if (i<=ubound(ver2Parts)) Then
on error resume next
v2 = Int(ver2Parts(i))
if not Err=0 Then
if (i<=ubound(ver1Parts)) Then
v1Str = ver1Parts(i)
else
v1Str = "0"
end if
v2Str = ver2Parts(i)
end if
else
v2 = 0
end if
if (not v1Str=UNASSIGNED or not v2Str=UNASSIGNED) Then
if (IsEmpty(v1Str)) Then
v1Str = "0"
end if
if (IsEmpty(v2Str)) Then
v2Str = "0"
End if
'WScript.echo "Comparing as strings: " & v1Str & " : " & v2Str
' Compare as Strings if either part could not be converted to a number
if (not v1Str="*" and not v2Str="*") Then
if (not v1Str=v2Str) Then
versionCompare = StrComp(v1Str,v2Str)
exit function
end if
end if
else
'WScript.echo "Comparing as numbers: " & v1 & " : " & v2
if (v1 > v2) Then
versionCompare = 1
exit function
end if
if (v2 > v1) Then
versionCompare = -1
exit function
end if
end if
i = i + 1
Loop
' If we got here, versions must be equal
versionCompare = 0

Advertisement

Table of Contents
loading

Table of Contents