Skip to main content
Known Participant
November 2, 2006
Question

Combining && and ||

  • November 2, 2006
  • 2 replies
  • 399 views
Is this a viable piece of script?

if (((variable1a == true) || (variable1b == true)) && ((variable2a == true) || (variable2b == true)) && (variable3 == true) && (variable4 == true)) {
//insert code here

I wasn't sure if you can combine all those and/or statements like that?

This topic has been closed for replies.

2 replies

Participating Frequently
November 2, 2006
Yep, you can. Also if all of the variables are Boolean you could simplify it to

if ( (variable1a || variable1b) && (variable2a || variable2b) && variable3 && variable4 ) {


Tim
kglad
Community Expert
Community Expert
November 2, 2006
yes.