mIRC Homepage

== or =? whats the differ between?,

Posted By: SteveNunes

== or =? whats the differ between?, - 10/07/16 02:05 AM

Well i always used == with (IF and WHILE) but today my friend show me a script that he made, and i saw that he's using only ONE = on his IF instead of ==. So, i made a test replacing ALL == for = on one of my scripts and it still working correctly. So, i want to know if theres really some differ on using == instead of =
Posted By: Wims

Re: == or =? whats the differ between?, - 10/07/16 02:18 AM

There's no difference. the '!' negate the operator, so technically != is negating '=', well that's one way to see it, == and = are equal.
Posted By: SteveNunes

Re: == or =? whats the differ between?, - 10/07/16 02:30 AM

i see, ty bro for the fast reply wink
Posted By: Collective

Re: == or =? whats the differ between?, - 10/07/16 08:11 AM

In other programming languages = is the assignment operator and == is the comparison operator. If you ever intend to write something other than mIRC scripts you should stick to using ==, just so you don't have to change your habits.
Posted By: FroggieDaFrog

Re: == or =? whats the differ between?, - 10/07/16 12:16 PM

Not only this, but in mIRC itself, '=' is an assignment operator so for code legibility its better to stick with using '=' for variable assignment and == for comparison.
Posted By: SteveNunes

Re: == or =? whats the differ between?, - 10/07/16 12:35 PM

I know about = being an assignment operator in other programming languages (i used to programing in c++ for a while) thats why i asked about the differ between == and = using mirc scripting...

anyway, ty for all replies guys wink
© 2021 mIRC Discussion Forums