newObjects-logo.gif (1024 bytes) ScriptManager2 reference
Eval method

Evaluates an expression in the context of the running script.

Set variable = object.Eval(script_expression)
variable = object.Eval(script_expression [, itemName])

variable depends on the expression the result of evaluation
object ScriptManager2 Previously created ScriptManager2 object
script_expression String Script statement that returns a result
itemName String Name of the script item that determines the context in which the expression will be evaluated (for advanced usage only).


This method  allows you to use a running host to evaluate an expression written in the loaded language and get the result. The result will depend on the script expression and can be anything the script supports - object, string, number etc. The expression is evaluated in the global script context by default. This means any variables found in the expression will be assumed as global script variables.

This is powerful technique and allows very interesting tricks such as evaluating a formula the user entered at run-time and so on.

Most of the script languages have functions - eval, execute or something similar. They are intended to execute or evaluate script text at run time. This method does exactly the same, but from outside.

See also:


newObjects Copyright newObjects 2001-2005