Discussion:
java or operator statement and expressions
(too old to reply)
R***@adobeforums.com
2009-02-21 17:32:53 UTC
Permalink
So I tried to simplify some code this morning using the java or operator and it doesn't seem to work. It went something like this:

if ((time < 4) || (time > 10))}
val = aVariable}
else val=0;

What I end up with is zero until 4 but after 10 the val does not return to 0.

I hope this makes sense to somebody out there. I just went back to a stack of if else statements to solve the problem.

Thanks
D***@adobeforums.com
2009-02-21 20:37:55 UTC
Permalink
I'm not sure what the problem is (except that your curly brackets are wrong), but this opacity expression works:

if ((time < 4) || (time > 10)){
0
}else{
100
}

Dan
R***@adobeforums.com
2009-02-21 23:24:46 UTC
Permalink
Thanks Dan. That was it.

When I'm coding at 3AM i tend to make silly type-os... and omissions!

Rick

Loading...