Achilles Posted September 7, 2006 Share Posted September 7, 2006 Well, if you read the title you go the jist of it. I'm just wondering why some people use "==" and some just use "="... I've always used "=" and it's worked fine... The helpfile says they are the same thing but then I don't see why it would include to identical ways to state something. Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
sohfeyr Posted September 7, 2006 Share Posted September 7, 2006 As it also says, = Tests if two values are equal (case insensitive if used with strings). e.g. If $var= 5 Then (true if $var equals 5) == Tests if two values are equal (case sensitive if used with strings) So: "Dog"="dog" is True "Dog"=="dog" is False Mine:Time Functions - Manipulate the system clock! | WinControlList (WinGetClassList++) | .Net Setup Wrapper, Detect or install .Net | Writing and using a VB .NET COM object in AutoItNot mine, but highly recommended:AutoItTreeViewExtension plugin | Menu code | Callback helper dll | Auto3Lib - Control the uncontrollable | Creating COM objects in AutoIt | Using .Net framework classes in AutoIt Link to comment Share on other sites More sharing options...
amfony Posted September 7, 2006 Share Posted September 7, 2006 (edited) sorry i may be very wrong in autoit - but in c++ and vbs '=' is an assignment to a variable , and '==' is a relational operator. IE 'variable assignment context a = 10 (vaue 10 is put into variable 'a') 'relational operator context if (a==10) Do correct me though if im wrong - im not up to speed with autoit as yet. EDIT: As im not up tp speed you should probably not listen to me hahaha. Read above for a better informed post. Edited September 7, 2006 by amfony Link to comment Share on other sites More sharing options...
sohfeyr Posted September 7, 2006 Share Posted September 7, 2006 Do correct me though if im wrong - im not up to speed with autoit as yet.It will work like you described, but not for that reason. Expressions are always rendered boolean for the if statement.With =, AutoIt lets the context determine if an expression is an assignment or a comparison. $var = "one" assigns "one" to $varConsider:ConsoleWrite((1=1)+3 & @cr) ConsoleWrite((1=1) & 3) Outputs:4True3You'd do well to experiment a little, and read up on "Operators" in the help file. I know a lot of people don't like help files, but this is a good one - well-designed, consistant, and genuinely useful. Honestly, I wish more help files were like it! Mine:Time Functions - Manipulate the system clock! | WinControlList (WinGetClassList++) | .Net Setup Wrapper, Detect or install .Net | Writing and using a VB .NET COM object in AutoItNot mine, but highly recommended:AutoItTreeViewExtension plugin | Menu code | Callback helper dll | Auto3Lib - Control the uncontrollable | Creating COM objects in AutoIt | Using .Net framework classes in AutoIt Link to comment Share on other sites More sharing options...
xcal Posted September 7, 2006 Share Posted September 7, 2006 I know a lot of people don't like help files, but this is a good one - well-designed, consistant, and genuinely useful. Honestly, I wish more help files were like it!I couldn't agree more. The Autoit helpfile is awesome. I'm not really much of a coder, but the help file is so well written, I've hardly had to ask any questions at all, and I've been able to do some really cool stuff all on my own. How To Ask Questions The Smart Way 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