PDA

View Full Version : easy one : if... and if


j00ey
09-21-2005, 04:03 PM
I'm trying to set some conditions to set particles lifespanPP but i can't figure out how to test multiple conditions... what I want to do is :

if (conditionA) AND (conditionB)
doThis;
else if (conditionA)
doThat;
else
doTheOther;

any help greatly appreciated
j00ey

Robert Bateman
09-21-2005, 04:53 PM
if( (conditionA) && (conditionB))
doThis;
else if (conditionA)
doThat;
else
doTheOther;

j00ey
09-21-2005, 05:04 PM
Ah! thanks very much. I tried &, and and, but not &&! [and not with the double brackets either]
I'll give it a go
j

john_homer
09-21-2005, 08:09 PM
you can also have OR, which can be quite handy... and probably as hard to find in the docs ;^)

if( (conditionA) || (conditionB))
doThis;

.j

CGTalk Moderation
09-21-2005, 08:09 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.