Jump to content
Sign in to follow this  
Radiance

Comparing any string to 0

Recommended Posts

Radiance

Hey all,

I'm having some major lack of understanding here.

$Var = 0
$String = "test"
MsgBox(0, "", $Var = $String)

 

Why is this True? Please explain.

Share this post


Link to post
Share on other sites
Radiance

To do a string compare you need to use ==

 

Is this the same like using String() on both items you are comparing?

Share this post


Link to post
Share on other sites
czardas

Yes (well almost). The == operator also tests for case sensitivity in strings, and that's the difference.

Edited by czardas
  • Like 1

Share this post


Link to post
Share on other sites
Radiance

==

I've never even seen that in any script before.

Thank you both for your answers.

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  

×