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

Combining && and ||

New Here ,
Nov 02, 2006 Nov 02, 2006

Copy link to clipboard

Copied

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

Views

251

Translate

Translate

Report

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

Copy link to clipboard

Copied

yes.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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