nhatlinhvietnam Posted March 20, 2009 Share Posted March 20, 2009 I have written a program with AutoIt and it has some problem.The program is here: $test = "-9" if isnumber($test) = 1 then Msgbox(0,"","-9 is a number") Else Msgbox(0,"","-9 is not a number") endif And it says: -9 is not a number But if i change it to: $test = "9" if isnumber($test) = 1 then Msgbox(0,"","9 is a number") Else Msgbox(0,"","9 is not a number") endif Then it says: 9 is a number I don't know what is happend but "-9" is not a number? Link to comment Share on other sites More sharing options...
bo8ster Posted March 20, 2009 Share Posted March 20, 2009 I would say "-9" is seen as dash 9 not negative 9. Have you tied Int(-9) or Int($test)? Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
nhatlinhvietnam Posted March 20, 2009 Author Share Posted March 20, 2009 Thank you very much but i cannot find thank button,Thanks!!!!!!!!!!! Link to comment Share on other sites More sharing options...
bo8ster Posted March 20, 2009 Share Posted March 20, 2009 button, what button? Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
bo8ster Posted March 20, 2009 Share Posted March 20, 2009 In case I was not clear, Int is a function, not a button. This works - $stest = "-9" $test = "" $test = Int($stest) if isnumber($test) = 1 then ConsoleWrite($test & " is a number") Msgbox(0,"",$test & " is a number") Else ConsoleWrite($test & " is not a number") Msgbox(0,"",$test & " is a number") endif Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
Danny35d Posted March 20, 2009 Share Posted March 20, 2009 $test = "-9" just remove the double quotes ("). Anything inside the double quotes AutoIt take it as string.Try it:$test = -9 if isnumber($test) = 1 then Msgbox(0,"","-9 is a number") Else Msgbox(0,"","-9 is not a number") endif AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
Vernes Posted March 20, 2009 Share Posted March 20, 2009 (edited) Are u Vietnamese ??? Read file help and view the example Have fun ) Edited March 20, 2009 by Vernes Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now