jbwhite 1 Posted January 20, 2012 (edited) 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 January 20, 2012 by jbwhite Share this post Link to post Share on other sites
engjcowi 1 Posted January 20, 2012 have a look at isnumber() and possibly use with an if statement Drunken Frat-Boy Monkey Garbage Share this post Link to post Share on other sites
jbwhite 1 Posted January 20, 2012 (edited) wait... Edited January 20, 2012 by jbwhite Share this post Link to post Share on other sites
jbwhite 1 Posted January 20, 2012 Alright, I got it with StringIsDigit() after struggling with IsNumber(), and googling IsNumber(), which led me to StringIsDigit() weeee but thanks for the help. Share this post Link to post Share on other sites
JohnOne 1,603 Posted January 20, 2012 Instead of using InputBox, you could have created a GUI with a style value $ES_NUMBER which only allows digits to be entered into it. 1 BrewManNH reacted to this AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
jbwhite 1 Posted January 20, 2012 eventually i will use gui's and that certainly sounds straightforward, just want to build up a better working knowledge of autoit first 1 JohnOne reacted to this Share this post Link to post Share on other sites
JohnOne 1,603 Posted January 20, 2012 Commendable standpoint. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
MilesAhead 23 Posted January 20, 2012 (edited) See this func by ProgAndy as it mimics the old Int() behavior Edited January 20, 2012 by MilesAhead My Freeware Page Share this post Link to post Share on other sites