jaberwacky Posted April 25, 2010 Share Posted April 25, 2010 (edited) If "04" == 4 Then MsgBox(0, '==', "TRUE") Else MsgBox(0, '==', "FALSE") EndIf If "04" = 4 Then MsgBox(0, '=', "TRUE") Else MsgBox(0, '=', "FALSE") EndIf These give different results. Will someone tell me why? "04" is a string and 4 is an integer. A string is an array of chars, right? '=' is the assignment operator and '==' is the equality operator. When I state "04" = 4, then am I not using the assigment operator? And if so then how am I assigning 4 into "04". Unless: Global $string = "04" ; $string stores "04" MsgBox(0, '', $string) "04" = 4 MsgBox(0, '', $string) ; now $string stores the char '4'? Ok, no that isn't it... Edited April 25, 2010 by jaberwocky6669 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
JohnOne Posted April 25, 2010 Share Posted April 25, 2010 http://www.autoitscript.com/forum/index.php?showtopic=113508 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
jaberwacky Posted April 25, 2010 Author Share Posted April 25, 2010 http://www.autoitscript.com/forum/index.php?showtopic=113508I originally posted my question there but they told me that I was actually talking about something slightly different, and so I posted a new thread. If I can find my answer there then I will delete this thread (or ask it to be deleted). Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
jaberwacky Posted April 25, 2010 Author Share Posted April 25, 2010 I originally posted my question there but they told me that I was actually talking about something slightly different, and so I posted a new thread. If I can find my answer there then I will delete this thread (or ask it to be deleted).Oh duh, I totally overlooked the answer. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
jaberwacky Posted April 25, 2010 Author Share Posted April 25, 2010 (edited) I dusted off my dusty, rusty helpfile:'==' Tests if two strings are equal. Case sensitive. The left and right values are converted to strings if they are not strings already. This operator should only be used for string comparisons that need to be case sensitive. Edited April 25, 2010 by jaberwocky6669 Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? 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