Editing Eval
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
|origin = NVSE | |origin = NVSE | ||
|summary = Added by NVSE V4. Reduces an expression to a boolean for use in | |summary = Added by NVSE V4. Reduces an expression to a boolean for use in conditional statements. Used to permit the usage of any function or expression that may be so reduced for a conditional, when the compiler would otherwise disallow it. | ||
Eval is required to test the value of [[User Defined Function|user defined functions]], and those related to [[Array Variable|arrays]] and [[String Variable|strings]] in | Eval is required to test the value of [[User Defined Function|user defined functions]], and those related to [[Array Variable|arrays]] and [[String Variable|strings]] in conditionals. | ||
|name = eval | |name = eval | ||
Line 9: | Line 9: | ||
|arguments = | |arguments = | ||
{{FunctionArgument | {{FunctionArgument | ||
|Name = | |Name = expression | ||
|Type = | |Type = reducable | ||
}} | }} | ||
}} | }} | ||
Line 43: | Line 43: | ||
==Notes== | ==Notes== | ||
*If struggling to understand the purpose of 'eval', then by analogy think of 'if eval' as simply telling the GECK compiler the line is written in NVSE language, to prevent it complaining with an error. | *If struggling to understand the purpose of 'eval', then by analogy think of 'if eval' as simply telling the GECK compiler the line is written in NVSE language, to prevent it complaining with an error. | ||
*Whilst not necessary, it is harmless to include 'eval' in any 'if' statement (when testing vanilla functions, for example). There is a possible advantage to this, in that when an illegitimate eval statement fails (example, testing certain functions on an empty ref var), an | *Whilst not necessary, it is harmless to include 'eval' in any 'if' statement (when testing vanilla functions, for example). There is a possible advantage to this, in that when an illegitimate eval statement fails (example, testing certain functions on an empty ref var), an error message will be printed to the game console, rather than silently failing. | ||
==See Also== | ==See Also== | ||
*[[User Defined Function]] | *[[User Defined Function]] | ||
*[[Array Variable]] | *[[Array Variable]] | ||
*[[String Variable]] | *[[String Variable]] | ||
==External Links== | ==External Links== | ||
*[http://obse.silverlock.org/obse_command_doc.html#OBSE_Expressions List of supported expression found in OBSE, these are equivalent in NVSE] | *[http://obse.silverlock.org/obse_command_doc.html#OBSE_Expressions List of supported expression found in OBSE, these are equivalent in NVSE] |