Difference between revisions of "Eval"
Jump to navigation
Jump to search
imported>QQuix (Created page with "{{Function | origin = OBSE | summary = Eval is used within if statements to test the value of an expression. This allows OBSE expressions to be used as conditions. The expre...") |
imported>QQuix (Oooops. forgot to add what I intended in the first place) |
||
Line 13: | Line 13: | ||
; code executes if array[0] > 1 | ; code executes if array[0] > 1 | ||
endif | endif | ||
===Notes=== | |||
When used to compare ref variables, Eval accepts the "==" or "!=" operators and does not accept the "<" or ">" operators | |||
ref MyRef | |||
. . . | |||
if eval MyRef == 0 ;<< OK | |||
... | |||
elseif eval MyRef != 0 ;<< OK | |||
... | |||
elseif eval MyRef > 0 ;<< Compile error: Invalid operands for operator > | |||
... | |||
elseif eval MyRef < 0 ;<< Compile error: Invalid operands for operator < | |||
... | |||
endif | |||
====See also ==== | ====See also ==== | ||
[[IF]] | [[IF]] |
Latest revision as of 12:21, 6 July 2013
< [[::Category:Functions|Category:Functions]]
A function added by the Oblivion Script Extender.
Syntax:
(bool) Eval expression
Eval is used within if statements to test the value of an expression. This allows OBSE expressions to be used as conditions. The expression must evaluate to a boolean value.
Example
if eval (array[0] > 1) ; code executes if array[0] > 1 endif
Notes
When used to compare ref variables, Eval accepts the "==" or "!=" operators and does not accept the "<" or ">" operators
ref MyRef . . . if eval MyRef == 0 ;<< OK ... elseif eval MyRef != 0 ;<< OK ... elseif eval MyRef > 0 ;<< Compile error: Invalid operands for operator > ... elseif eval MyRef < 0 ;<< Compile error: Invalid operands for operator < ... endif