Jump to content
Sign in to follow this  
crash748

What the bug with $x=0 ???

Recommended Posts

crash748

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

Share this post


Link to post
Share on other sites
crash748

$x is a number

"none" is a word.

change "none" to $x in your code.

But if i put $x=1 it's work, that make no sense for me.

Share this post


Link to post
Share on other sites
Mison

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 ;)

Share this post


Link to post
Share on other sites
crash748

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!

Share this post


Link to post
Share on other sites
Mison

Thanks Volly, now I understand... :)


Hi ;)

Share this post


Link to post
Share on other sites
crash748

I know understand too! Thanks Volly!

Edited by crash748

Share this post


Link to post
Share on other sites
Mison

I think this link - Uten's tutorial on using arrays - A Must Read! - is broken. Anyways thanks a lot for sharing


Hi ;)

Share this post


Link to post
Share on other sites
bo8ster

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]

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  

×