2.6.4.9. execute_ExecuteFunction()

[<<<] [>>>]

This function is used by the embedding layer (aka scriba_ functions) to execute a function. This function is not directly called by the execution of a ScriptBasic program. It may be used after the execution of the program by a special embeddign application that keeps the code and the global variables in memory and calls functions of the program.

The function takes pEo as the execution environment. StartNode should be the node where the sub or function is defined. cArgs should give the number of arguments. pArgs should point to the argument array. pResult will point to the result. If pResult is NULL the result is dropped. Otherwise the result is a mortal variable.

Note that this code does not check the number of arguments you provide. There can be more arguments passed to the SUB than it has declared, therefore you can initialize the local variables of the sub. (You should know that arguments are local variables in ScriptBasic just as any other non-argument local variable.)

The arguments should be normal immortal variables. They are passed to the SUB by reference and in case they are modified the old variable is going to be released.

piErrorCode returns the error code of the execution which is zero in case of no error.

void execute_ExecuteFunction(pExecuteObject pEo,
                             unsigned long StartNode,
                             long cArgs,
                             pFixSizeMemoryObject *pArgs,
                             pFixSizeMemoryObject *pResult,
                             int *piErrorCode
  )@{

[<<<] [>>>]