The Ferite Developers Guide - Extending and Embedding The Ferite Engine | ||
---|---|---|
Prev | Chapter 4. Accessing Ferite Internals | Next |
Sometimes it is easier to execute a block of code, from within a function, written in ferite. For this you can use the eval mechanism. What this does is the same as the eval operator in ferite. It will compile and execute the script and then return the return value of the main function. For example:
rval = ferite_script_eval( script, "Console.println('Hello World');" ); |
You must destroy the return value using ferite_variable_destroy just as you would a function call.