| Applying science to business management |
  
eval
Format: eval( text )
Arguments: [text] text Text string containing
any valid DScript expression(s)
Returns: [any] Result of evaluating the expression(s) text
Description: Eval compiles and evaluates a text string
as a DScript command. If text contains a list of strings,
a list of evaluated results is returned.
When you create a tree node that uses the eval
primitive, the tree editor will not include references to nodes
in the text argument as child branches. For example, the
following tree displays only the node B as a child of A even
though the node C is technically also a child.
To define node names in quoted text as child nodes, place a \+
immediately before the node name as in the following example:
The presence of \+ does not affect execution in any way. It is
only a cue to the tree editor to interpret the following
characters as a node name.
Examples: eval("2+3*4")
= 14
eval("f(x):=x^2-4") = creates
a function named f(x)
eval(["2+3","PI"])
= [5,3.142]
See Also: tonumber,
tolist
|