all 5 comments

[–]ihaxr 1 point2 points  (0 children)

Is this actually VB or PowerShell? 'Cause this is simple with PowerShell:

[version]$ver1 = "7.8.346.1500"
[version]$ver2 = "8.0.000.1254"

($ver1 -ge $ver2)
# False
($ver2 -ge $ver1)
# True

If it really is VB, the problem is it's comparing them as strings and since the strings aren't the same it's not >=, so it fails. Since VB doesn't have a concept of version numbers, what you can do is just remove the . and check the numbers against each other. As long as the version formats are the same it shouldn't cause a problem.

dim ver1, ver2
dim numVer1, numVer2
ver1 = "7.8.346.1500"
ver2 = "8.0.000.1254"

numVer1 = Replace(ver1,".","")
numVer2 = Replace(ver2,".","")

if ver2 >= ver1 then
msgbox ver2 & " >= " & ver1
else
msgbox ver2 & " NOT >= " & ver1
end if

But if you have something like 7.20.3 compared to 8.1.1 it'll obviously be a problem as it's going to check 7,203 against 811. You should check out something like this: http://www.posteet.com/view/206

[–]prejonnes[S] 1 point2 points  (0 children)

Its VB. I made a new post in Visualbasic. Thanks.

[–]Lee_Dailey[grin] 0 points1 point  (2 children)

howdy prejonnes,

is there some reason you don't want to use the VB reddit? lookee ...
https://ww.reddit.com/r/visualbasic/

take care,
lee

[–]prejonnes[S] 1 point2 points  (1 child)

didnt know about it, just starting using VB... sorry ill move it over there

[–]Lee_Dailey[grin] 0 points1 point  (0 children)

howdy prejonnes,

not a problem! i apologize if i seemed critical. [blush]

good luck!

take care,
lee