Sign in to follow this  
Followers 0
bear

Bug? or Misunderstanding?

3 posts in this topic

$Key = 0

If $Key = "{SPACE}" Then

MsgBox(0, "??", "???")

EndIf

This script will prompt message box ....

0 == "{SPACE}" ?????

Share this post


Link to post
Share on other sites



First of all, why are you comparing a number to a string? Second, the behavior is expected. The string is promoted to a number. Since the string itself is not a number, it becomes "0". Therefore, zero is compared to zero which is of course true.

Share this post


Link to post
Share on other sites

...

0 == "{SPACE}" ?????

No.. per your question

$Key = 0

If $Key == "{SPACE}" Then
    MsgBox(0, "??", "???")
EndIf

This script will NOT prompt message box ....

8)


NEWHeader1.png

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  
Followers 0