-
Using && in if/else statements
Hi
I have slider control attached to a null object aimed to convert collected values based on the content of two text fields. I’m using the && symbol to bring both sides of my statement together.
In plain English:
if text1 and text2 don’t say “the magic word” : slider value = 0
if text1 says “the magic word,” but text2 doesn’t: slider value = 1
if text1 doesn’t says “the magic word,” but text2 does: slider value = 2
if text1 and text2 both say “the magic word” : slider value = 3
My coding:
away = thisComp.layer(“AWAY TEAM FEEDBACK”).text.sourceText;
home = thisComp.layer(“HOME TEAM FEEDBACK”).text.sourceText;
if (away != “TEAM1” && home != “TEAM1”)
{
0} else
if (away = “TEAM1” && home != “TEAM1”)
{
1} else
if (away != “TEAM1” && home = “TEAM1”)
{
2} else
if (away = “TEAM1″&& home = “TEAM1”)
{
3} else
{100}
THANKS FOR YOUR TIME