Sign in to follow this  
Followers 0
Guest NHTester

Math.au3

2 posts in this topic

I just recently started using AutoIT3 and one of the first things I played with were the _Min and _Max functions in Math.au3. I wrote a script that prompted the user for two numbers. I then saved these numbers and called the _Max function to compare these numbers. It appears that when I do this the values the user enters are saved as strings and the _Max function doesn't do the compare properly.

For example, if the user enteres '6' and '56', the _Max function returns '6' rather than '56'. However, if I simply call the function as _Max(6,56), 56 is returned as expected.

Any feedback would be appreciated.

I included my script below for better clarification.

Thanks.

#include <Math.au3>

$number = InputBox("AutoIt Example", "Please type in a number and click OK")

$number2 = InputBox("AutoIt Example", "Please type in a number and click OK")

$highernumber = _Max ($number, $number2)

MsgBox (0, "This is the highest number", $highernumber)

Share this post


Link to post
Share on other sites



Thanks that did the trick.....and thank you for the quick response.

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