Highlighted

Expression Error: If Else not working???

Community Beginner ,
May 21, 2020

Copy link to clipboard

Copied

V = effect("Slider Control")("Slider");

if (V > 0) X = 100 else X = 0;

[X,X]

 

This is just about as simple as it gets but I get this error:

 

Error: Syntax error: Unexpected token else (And this is about line 2 obviously)

 

What? I could swear this is similar to what I've done before. Help me out!

TOPICS
Error or problem, Expressions, How to

Views

366

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

Expression Error: If Else not working???

Community Beginner ,
May 21, 2020

Copy link to clipboard

Copied

V = effect("Slider Control")("Slider");

if (V > 0) X = 100 else X = 0;

[X,X]

 

This is just about as simple as it gets but I get this error:

 

Error: Syntax error: Unexpected token else (And this is about line 2 obviously)

 

What? I could swear this is similar to what I've done before. Help me out!

TOPICS
Error or problem, Expressions, How to

Views

367

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
May 21, 2020 0
Community Beginner ,
May 21, 2020

Copy link to clipboard

Copied

Never mind, I got it. Curly brackets... {100} {0} or legacy ExtendScript in project settings.

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...
May 21, 2020 0
Guide ,
May 21, 2020

Copy link to clipboard

Copied

Or:  

X = (V > 0) ? 100 : 0;

 

Dan

 

 

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...
May 21, 2020 0