mIRC Home    About    Download    Register    News    Help

Print Thread
== or =? whats the differ between?, #258484 10/07/16 02:05 AM
Joined: Mar 2016
Posts: 24
S
SteveNunes Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2016
Posts: 24
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 =

Re: == or =? whats the differ between?, [Re: SteveNunes] #258485 10/07/16 02:18 AM
Joined: Jul 2006
Posts: 3,530
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,530
There's no difference. the '!' negate the operator, so technically != is negating '=', well that's one way to see it, == and = are equal.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: == or =? whats the differ between?, [Re: Wims] #258486 10/07/16 02:30 AM
Joined: Mar 2016
Posts: 24
S
SteveNunes Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2016
Posts: 24
i see, ty bro for the fast reply wink

Re: == or =? whats the differ between?, [Re: SteveNunes] #258489 10/07/16 08:11 AM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
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.

Re: == or =? whats the differ between?, [Re: Collective] #258490 10/07/16 12:16 PM
Joined: Apr 2010
Posts: 910
F
FroggieDaFrog Online
Hoopy frood
Online
Hoopy frood
F
Joined: Apr 2010
Posts: 910
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
Re: == or =? whats the differ between?, [Re: FroggieDaFrog] #258491 10/07/16 12:35 PM
Joined: Mar 2016
Posts: 24
S
SteveNunes Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Mar 2016
Posts: 24
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