Skip to main content
Participant
September 15, 2023
Question

AE expression error when using // or /*

  • September 15, 2023
  • 1 reply
  • 208 views

Hi 🙂 every time i try "comment out" something in my expression i get the expression error banner. Is there any other way to put comments in your code in AE?

 

thanks!

This topic has been closed for replies.

1 reply

Community Expert
September 15, 2023

//Comment

ref = thisComp.layer(index -1);

 

Should work. Leave out the apostrophe, and things will break.

 

What does the expression look like when a comment fails? I'm not seeing the problem anywhere.

Participant
September 15, 2023

Thank you for taking time to answer!

 

well, it looks like ae doesn't allow you to comment out all the code within an expression 🙂

that solves my problem. sorry for bothering

Community Expert
September 15, 2023

This will comment out everything between the punctuation and let what follows run. You just have to complete the process.

/*
ref = thisComp.layer(index - 1).position;
*/

ref2 = thisComp.layer(index + 1).position;

The commented section between /* and */ disables looking at the layer above for position.  It should be working that way for you.