simCallScriptFunctionEx

Calls a script function (from a plugin, the main client application, or from another script). This represents a user callback inside of a script. The target script must be initialized for this call to succeed, e.g. when calling simulation scripts, then simulation must be running

Data exchange between a plugin and a script happens via a stack. Reading and writing arguments from/to the stack gives you a maximum of flexibility, and you wil be able to exchange also complex data structures. But it can also be tedious and error prone. Use instead the helper classes located in programming/include/simStack: they will greatly simplify the task. Have a look at the example plugins simSkeleton and simSkel

C++ synopsis

int simCallScriptFunctionEx(int scriptHandleOrType, const char* functionNameAtScriptName, int stackId)

Arguments

  • scriptHandle: the handle of the script
  • functionName: the function to call.
  • stackId: a stack handle. The stack represents the function's in/out values. See also the available stack functions.

Return

  • -1 in case of an error


See also: