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

Expression Error: If Else not working???

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

1.5K

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

LATEST

Or:  

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

 

Dan

 

 

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