ID:1824309
 
(See the best response by Mr_Goober.)
Code:
if(src in ListName)
else
//Do stuff


Problem description:

What if I don't want to do anything if it's in the list, and only if it's NOT in the list, is there an equiavalent, like I can do if(variableName!="value") what's the equivalent for not being in the list.
 If(!ListName.Find(src))
Best response
Alternatively:
if (!(theobject in somelist))

also works

Edit: woops. My mistake. Simply didn't think about that for a second.
In response to Mr_Goober
Mr_Goober wrote:
Alternatively:
for (!(var/d in somelist))
also works

Uh...what do you think that'll even do?

The real alternative:
if(!(src in ListName))
//do the thing.


src in ListName would evaluate to false, if src is not in the list. Then, the ! flips the boolean, evaluating to true - meaning the contents of the if statement would execute.

However, someone else suggested the adding an !in operator at id:1605373.
In response to Super Saiyan X
Super Saiyan X wrote:
Mr_Goober wrote:
Alternatively:
> for (!(var/d in somelist))
>
also works

Uh...what do you think that'll even do?

By the looks of it, he's creating a loop to check for every single entity - it should work if the list is null, but no idea why you'd do that over a length check. Unless I'm missing something?
Can confirm what SSX is saying: That bit of code that goober posted is not proper syntax.

for(var/d in somelist) is a special pattern that loops through every object in a list.

for(!(var/d in somelist)) is syntactic nonsense. It's completely meaningless.
My apologies. That's what I meant to put. Simply wasn't thinking at the time.