FlowscopeDocs

S007

constructor does not fit the declaration keyword

Severity Error

Each declaration keyword expects a particular constructor after =: data takes subscribe(...), plot takes a plot.* constructor, pane takes pane(...), alert takes alert(...), fill takes fill.between(...) and input takes an input.* call. The right-hand side here belongs to a different kind of declaration.

Use the keyword that matches the constructor, or the constructor that matches the keyword.

Failing example

Flowscope Script
script "OI line"
plot oi = subscribe(data.oi)
on oi.close {
  log.info(str.formatVolume(oi.close ?? 0.0))
}

Fixed example

Flowscope Script
script "OI line"
data oi = subscribe(data.oi)
on oi.close {
  log.info(str.formatVolume(oi.close ?? 0.0))
}