Call to non-const global function not allowed here

You cannot call a function declared in the global section of a formula from another section, unless the function is marked as const. This rule prevents modification of variables in the global section once the global section has finished executing.

global:
  func test()
  endfunc

init:
  test()  ; Error!

To fix this, mark the function as const. This means that it cannot modify any global variables, though.

global:
  func test() const
  endfunc

init:
  test()  ; OK

See Also
Errors