Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Combining && and ||

New Here ,
Nov 02, 2006 Nov 02, 2006
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?

TOPICS
ActionScript
378
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 02, 2006 Nov 02, 2006
yes.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 02, 2006 Nov 02, 2006
LATEST
Yep, you can. Also if all of the variables are Boolean you could simplify it to

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


Tim
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines