Radiance Posted November 26, 2014 Share Posted November 26, 2014 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. Link to comment Share on other sites More sharing options...
Developers Solution Jos Posted November 26, 2014 Developers Solution Share Posted November 26, 2014 This is because you are comparing numerically and a string is equal to zero. To do a string compare you need to use == Jos Radiance 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Radiance Posted November 26, 2014 Author Share Posted November 26, 2014 To do a string compare you need to use == Is this the same like using String() on both items you are comparing? Link to comment Share on other sites More sharing options...
czardas Posted November 26, 2014 Share Posted November 26, 2014 (edited) Yes (well almost). The == operator also tests for case sensitivity in strings, and that's the difference. Edited November 26, 2014 by czardas Radiance 1 operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Radiance Posted November 27, 2014 Author Share Posted November 27, 2014 == I've never even seen that in any script before. Thank you both for your answers. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now