Jump to content
Sign in to follow this  

Comparing version numbers

Recommended Posts


Need some help figuring out how to compare variables.

Here's my example of a comparison that works:

$var = "1.2.3"

$var1 = "1.2.4"

if $var < $var1 then msgbox (0,"", "True")

The problem is, I need the operator to be a variable as well. I've been trying to use Exeucte(), but the problem is that it fails if there is more than one decimal in the string.

For example:

$var = "1.2.3"

$var1 = "1.2.4"

$operator = "<"

$return = Execute ($var & $operator & $var1)

msgbox (0,"", $return)

Edited by bratton

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...