eval: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
(No difference)

Revision as of 01:53, 7 March 2009

eval() Function

Evaluates and "executes" the expression in a string and returns the result. The string contains the same type of expression that is between {} or [r: ]

Usage

[h: result = eval(expr)]

Examples

[r: eval("1+1")]

Returns

   2
[r: eval("3d1")]

Returns

   3
[r: eval("blah = 2")]

Returns

   2
[h: blah = 2][r: eval("blah/2")]

Returns

1