Jump to content
Sign in to follow this  
bratton

Comparing version numbers

Recommended Posts

bratton

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

Share this post


Link to post
Share on other sites
bratton

No Jos,

No, I had not seen that. Looks promising though. I'll give it a shot.

Thanks for the reply.

Share this post


Link to post
Share on other sites
mitsos

Thanks from me too...

I was just looking for a "version comparison".

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.