Sign in to follow this  
Followers 0
bratton

Comparing version numbers

4 posts in this topic

#1 ·  Posted (edited)

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



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

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  
Followers 0