eval

From RPTools Wiki
Jump to navigation Jump to search

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