Jump to content

Comparing version numbers


Recommended Posts

Hello,

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
Link to comment
Share on other sites

  • 1 month later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...