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

Error: Syntax Error: Unexpected token else

New Here ,
Oct 02, 2021 Oct 02, 2021

Hola soy nuevo en after effects y tengo un problema con esta expresión 


velocidad=1;
contadorInicial=TuDeslizador*60;

tiempoContador=Math.floor(contadorInicial - velocidad*time);

minutos=Math.floor(tiempoContador/60);
segundos=tiempoContador%60;
if (tiempoContador > 0 && time < tiempoContador){
Cero(minutos) + ":" + Cero(segundos);
} else ("00:00");

function Cero(n){
if(n<10) return "0" + n else return n;
}

 

siendo especifico en esta parte 

if(n<10) return "0" + n else return n;

mi after effects dice: Error: Syntax Error: Unexpected token else

 

TOPICS
Error or problem , Expressions
561
Translate
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
LEGEND ,
Oct 02, 2021 Oct 02, 2021
LATEST

You are not using the correct brackets or for that matter not any brackets at all. All branching statemnts must be enclosed in curly brackets, not parentheses and those rules are even stricter when using the new engine. You really need to work on making your syntax cleaner.

 

Mylenium

Translate
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