Quote:
Originally Posted by ownedbycats
Thanks
New question.
Code:
program:
if
list_count($#fanficcat, ',') == 3
&& 'Crossover' in $#fanficcat
&&
('Mass Effect Trilogy' in $#fanficcat && 'Mass Effect: Andromeda' in $#fanficcat)
||
('Half-Life' in $#fanficcat && 'Portal' in $#fanficcat)
then
'yes'
fi
Three checks:
1. There are three items in the taglike #fanficcat.
2. One of them is 'Crossover.'
3. The other two are either "Mass Effect Trilogy, Mass Effect Andromeda" or "Half-Life, Portal."
Examples, to make it more clear:
However, I messed up the operators as I'm getting 'yes' on a book where #fanficcat is "Half-Life, Portal" (two items and it does not include crossover). Where did I make the mistake?
|
|| is lower priority than && so the clause after the || stands alone. You must put parentheses around the pair of clauses in the ||.
I recommend you always use parentheses to ensure that clauses are grouped how you want.