That is quite interesting as I get the following with 4.50 and 4.52rc1:
c:\data\scripts>..\kix\kix.450\kix32 compareversions.kix
No upgrade necessary
FALSE - 8.0.0.912 < 8.0.0.912
False - "10.0.1.123" < "10.0.1.9"
True - "10.0.1.123" > "10.0.1.9"
False - "10.0.1.123" = "10.0.1.9"
Just in case I changed something in the UDF I will repost it.
Code:
function CompareVersions($version1, $comparison, $version2, optional $split)
dim $Ver1array, $Ver2array, $Ver1arrayCnt, $Ver2arrayCnt
dim $index, $maxindex
if VarTypeName($split) <> "String" $split = "." endif
$Ver1array = split($version1, $split)
$Ver1arrayCnt = ubound ($Ver1array)
$Ver2array = split($version2, $split)
$Ver2arrayCnt = ubound ($Ver2array)
Select
case $Ver1arrayCnt <= $Ver2arrayCnt
$maxindex = $Ver2arrayCnt
redim preserve $Ver1array[$maxindex]
case $Ver1arrayCnt > $Ver2arrayCnt
$maxindex = $Ver1arrayCnt
redim preserve $Ver2array[$maxindex]
case 1
;something is wrong
EndSelect
$CompareVersions = 1
for $index = 0 to $maxindex
dim $difference
$difference = val($Ver2array[$index]) - val($Ver1array[$index])
Select
case $comparison = "="
if $version1 <> $version2
$CompareVersions = 0
$index = 1+$maxindex
endif
case $comparison = "<"
if $difference < 0 or $version1 = $version2
$CompareVersions = 0
$index = 1+$maxindex
endif
case $comparison = ">"
if $difference > 0 or $version1 = $version2
$CompareVersions = 0
$index = 1+$maxindex
endif
Endselect
next
endfunction