Jump to content
Sign in to follow this  
bear

Bug? or Misunderstanding?

Recommended Posts

bear

$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
Valik

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
Valuater

...

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  

×

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.