Highlighted

Code explanation

Community Beginner ,
Sep 06, 2020

Copy link to clipboard

Copied

I need explanation cuz I don't get this.
This || is or, and && is and, right?
so why if I use like this
if(PW1 == 0 && PS < 5){
PW2G.display = display.visible;
PW2B.display = display.hidden;}

it triggers on either PW1 or PS it doesn't matter which one.
Shouldn't it need both requirements to trigger?

And if I use with || it needs both requirement and it shouldn't, it would need PW1 or PS right?
it's like && and || changed roles or I'm not getting something here?

Topics

How to

Views

25

Likes

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

Code explanation

Community Beginner ,
Sep 06, 2020

Copy link to clipboard

Copied

I need explanation cuz I don't get this.
This || is or, and && is and, right?
so why if I use like this
if(PW1 == 0 && PS < 5){
PW2G.display = display.visible;
PW2B.display = display.hidden;}

it triggers on either PW1 or PS it doesn't matter which one.
Shouldn't it need both requirements to trigger?

And if I use with || it needs both requirement and it shouldn't, it would need PW1 or PS right?
it's like && and || changed roles or I'm not getting something here?

Topics

How to

Views

26

Likes

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
try67 LATEST
Most Valuable Participant ,
Sep 06, 2020

Copy link to clipboard

Copied

Yes, that's correct, but what you're describing is impossible. There must be something else at hand here.

Can you post the full code, and/or share the actual file?

Likes

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
Reply
Loading...
Resources
One Stop Solution for Acrobat
Edit a PDF