erebus 1 Posted November 11, 2004 I use the following code: $no=1 Select Case Not IsNumber($no) MsgBox(0, "DEBUG", "$no is not a number") Exit EndSelect This works as expected. $no IS a number. Now I alter the above code as: $no = IniRead($ini, "Something", "Number", "NOTEXIST") Select Case Not IsNumber($no) MsgBox(0, "DEBUG", "$no is not a number") MsgBox(0, "DEBUG", $no + 1) Exit EndSelect "Number" in $ini = 1. Now AutoIT does not recognize $no as a number, executes the first MsgBox to indicate the error, however the result of the second MsgBox is "2". Can you explain this? If I'm doing something really stupid (headache rules) shoot me freely. Share this post Link to post Share on other sites
Mr.Wizard 0 Posted November 11, 2004 And why are you using a Select when there's only one condition? Why not use an If? I have a catapult. Give me all the money or I will fling an enormous rock at your head. Share this post Link to post Share on other sites
erebus 1 Posted November 11, 2004 (edited) @Larry: Why can't I find this function? (using the latest unstable) @Mr.Wizard: Just posted a sort example, there are more conditions in my case (that's why the Select function was used). Edit: Solved - used: $no = IniRead($ini, "Something", "Number", "NOTEXIST") Select Case Not Number($no) Thanks anyway guys Edited November 11, 2004 by erebus Share this post Link to post Share on other sites
SlimShady 1 Posted November 11, 2004 I suggest you use StringIsDigit$no = IniRead($ini, "Something", "Number", "NOTEXIST") Select Case StringIsDigit($no) MsgBox(0, "DEBUG", "$no is not a number") MsgBox(0, "DEBUG", $no + 1) Exit EndSelect Share this post Link to post Share on other sites
Jos 2,177 Posted November 11, 2004 @Larry: Why can't I find this function? (using the latest unstable)@Mr.Wizard: Just posted a sort example, there are more conditions in my case (that's why the Select function was used).Edit: Solved - used:$no = IniRead($ini, "Something", "Number", "NOTEXIST") Select Case Not Number($no)Thanks anyway guys <{POST_SNAPBACK}>Try this and see if that explains it:$no = 1 if Not IsNumber($no) then MsgBox(0, "DEBUG 1 ", "$no is not a number") $no = "1" if Not IsNumber($no) then MsgBox(0, "DEBUG 2", "$no is not a number") SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
erebus 1 Posted November 11, 2004 (edited) @JdeB: Thank you, I also got the same answer from Larry:IniRead returns a string...@SlimShady: Very good idea! Already updated, thank you. I think that is what Larry means. Edited November 11, 2004 by erebus Share this post Link to post Share on other sites