Jump to content
Sign in to follow this  
nhatlinhvietnam

Please help me! :((

Recommended Posts

nhatlinhvietnam

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?

Share this post


Link to post
Share on other sites
bo8ster

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]

Share this post


Link to post
Share on other sites
nhatlinhvietnam

Thank you very much but i cannot find thank button,Thanks!!!!!!!!!!!

Share this post


Link to post
Share on other sites
bo8ster

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]

Share this post


Link to post
Share on other sites
bo8ster

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]

Share this post


Link to post
Share on other sites
Danny35d

$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

Share this post


Link to post
Share on other sites
Vernes

Are u Vietnamese ??? Read file help and view the example

Have fun :P)

Edited by Vernes

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.