Programmer's Guide > Interfaces > ScriptContext interface > loadScriptText method
  
loadScriptText method
Compiles and evaluates the script expression and returns the result as a string.
loadScriptText(script [, scriptType] )
Parameters
Stringscript
The string containing the script.
unsigned shortscriptType
[optional] A value from the scriptType definition indicating how to interpret the script text. The script can be either a statement or an expression (not all script engines make this distinction). It can also be evaluated in either private or global scope. If it is evaluated in private scope names in the script text will be discarded on return from this method. If it is evaluated in global scope top-level objects and names will persist after the call. If not provided the default is to evaluate the script as an expression in global scope.
Returns
String. The result value as a string if scriptType is an expression.