Jump to content

Please help me! :((


Recommended Posts

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

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

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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...