Jump to content

What the bug with $x=0 ???


 Share

Recommended Posts

I have a problem with my script...

here the part witch bug me:

$x=0
If $x <> "NONE" Then msgbox(0,"",$x&" <> NONE")

Did anybody can explain to me why this don't work?

For me this is suppose to pop the msgbox but nothing the expression is calculate as false

Edited by crash748
Link to comment
Share on other sites

x = 0 ; 0 is a number, or as a Boolean value(false)

"NONE" ; string...

So when you compare "0" = "NONE", it turns out false..

Replace "NONE" with False or 0 to make this statement true

EDIT:My bad, I didn't see the "<>" sign.. 0<>"none" supposed to be true

Edited by Mison

Hi ;)

Link to comment
Share on other sites

x = 0 ; 0 is a number, or as a Boolean value(false)

"NONE" ; string...

So when you compare "0" = "NONE", it turns out false..

Replace "NONE" with False or 0 to make this statement true

EDIT:My bad, I didn't see the "<>" sign.. 0<>"none" supposed to be true

You are right but there is the problems! Autoit Make it turn true!

I'am using AutoIt 3.3.0.0 try this little code:

Local $x = 0
If $x = "blue" Then MsgBox(0, "", "$x = blue")

AutoIt make it as true! I don't undestand!

Link to comment
Share on other sites

You can also take a look at the tutorials on YouTube if you want to learn more. Look for the link in my signature.

YouTube help, I never knew! I had only read the first 3 lines of ur sig - they are good.

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...