Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS2013

error This call returns no value.

#What it means

This call does something (such as writing a log line) but returns no value, so its result cannot be stored or passed on.

#Typical cause

  • Assigning the result of log.info, alert.send or a user function whose body ends in such a call.
  • Passing such a call as an argument.

#How to fix it

Call it as a statement on its own line.

#Example

ChartScriptError: CS2013
//@chartscript 1
indicator("Log")
const msg = log.info("bar {0}", bar_index)
plot(close)

Fixed

ChartScriptOpen in editor
//@chartscript 1
indicator("Log")
log.info("bar {0}", bar_index)
plot(close)
  • CS2012 — This returns got values but expected names are given.
  • CS2009 — name is not a function.

The ChartScript documentation is in English for now; translations will follow.