1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

!equals versus isnot

Discussion in 'Scripts' started by greatguys1, May 17, 2018.

  1. greatguys1

    greatguys1 Active Adventurer Developer Warriors of the North

    279
    34
    Apr 20, 2013
    Yes
    I kinda feel like !equals isn't a thing, I dunno where I picked it up from, but now I feel like I should look in all the scripts I've done to see if I stuck that in somewhere... but just before I do that, does !equals happen to have the same function as isnot?
     
  2. Thothie

    Thothie Administrator Staff Member Administrator Moderator Developer

    15,079
    54
    Apr 8, 2005
    psycho-oligist
    lost
    Code:
    else if( CompareParam == "isnot" || CompareParam == "!equals" ) iCompareType = 1;
    It is a thing and it's just redundancy due to convention... Thankfully we did not carry it so far as to have an "!isnot". ;)

    There's also "!startswith" and "!contains" (ie. does not start with "x" or does not contain "x").

    I've come across a few situations where an $if(<val>,<comp>,<val>) function would make things a bit shorter, but I've not implemented it, and of course, we're still stuck with one comparison per if statement, though, unlike VS2003 C++, you can "else if" until the end of eternity in MSC scripts, as far as I know.
     
  3. greatguys1

    greatguys1 Active Adventurer Developer Warriors of the North

    279
    34
    Apr 20, 2013
    Yes
    Phew. Saved me a bit of time checking everything :p
    Thank you
     

Share This Page