eval

From RPTools Wiki
Revision as of 08:17, 24 December 2008 by Craig (talk | contribs) (New page: ==Function Eval== 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: ]''' ===Us...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function Eval

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