mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2016
Posts: 25
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2016
Posts: 25
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 =

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
There's no difference. the '!' negate the operator, so technically != is negating '=', well that's one way to see it, == and = are equal.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Mar 2016
Posts: 25
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2016
Posts: 25
i see, ty bro for the fast reply wink

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
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.

Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
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.


I am SReject
My Stuff
Joined: Mar 2016
Posts: 25
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2016
Posts: 25
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


Link Copied to Clipboard