Jump to content
Sign in to follow this  

Separating numeric from everything else

Recommended Posts

Searched google and this forum, couldn't find an answer.

Note; autoit is the only scripting I've ever done in my life, if it sounds like I know nothing about this, it's quite simple, I don't.

I have written a simple little script to change the volume when given a percentage (0-100).

It works great, no problems.

It uses inputbox to ask for a percent that is inputed and it changes the volume to that.

No problems.

However, I want to specify that the value entered cannot be anything but numeric, ei, I have written it so that if you input anything greater than 100 or less than 0 a msgbox will pop up (saying "you dun' goofed" - approx.) and nothing will happen, script exits. Beautiful.

So how do I write it to say that if $box (my var) is not a number, then I can make another msgbox pop up and say something along the lines of "use numbers ya idiot"

Does that make sense?

Thanks in advance.

Edited by jbwhite

Share this post

Link to post
Share on other sites

Alright, I got it with StringIsDigit() after struggling with IsNumber(), and googling IsNumber(), which led me to StringIsDigit()


but thanks for the help.

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...