Difference between revisions of "TES5Edit Scripting Functions"

→‎Pascal implementation: JvInterpreter: "Where we're going, we don't need sanity checks!"
imported>DavidJCobb
(→‎Unsupported keywords: JvInterpreter doesn't support "in")
imported>DavidJCobb
(→‎Pascal implementation: JvInterpreter: "Where we're going, we don't need sanity checks!")
Line 843: Line 843:
* JvInterpreter doesn't throw errors if multiple files use the same unit name, but having multiple files use the same unit name will break the parser. Errors like "''Error in unit 'UnitName' on line 42: 'begin' expected but 'x' found''", where "x" is the middle of another keyword, a variable name, or even a string, are common in this situation.
* JvInterpreter doesn't throw errors if multiple files use the same unit name, but having multiple files use the same unit name will break the parser. Errors like "''Error in unit 'UnitName' on line 42: 'begin' expected but 'x' found''", where "x" is the middle of another keyword, a variable name, or even a string, are common in this situation.
* JvInterpreter does not short-circuit conditions such as <code>If Assigned(myList) And (myList.IndexOf('Test')) Then</code>; even if the first clause fails, the second will still execute (and end up throwing an exception). You need to nest the conditions: <code>If A Then If B Then C;</code>.
* JvInterpreter does not short-circuit conditions such as <code>If Assigned(myList) And (myList.IndexOf('Test')) Then</code>; even if the first clause fails, the second will still execute (and end up throwing an exception). You need to nest the conditions: <code>If A Then If B Then C;</code>.
** A simpler example: <code>If (myInt = 0) Or (otherInt Mod myInt = 0)</code> will yield a divide-by-zero error.
* Be careful when refactoring your code. If you move functions between units, JvInterpreter will not handle this sanely; calling the function on the old unit (i.e. <code>WrongUnit.SomeFunction;</code>) is likely to cause a memory access violation without any intelligible explanation.


==== xEdit extensions to JvInterpreter ====
==== xEdit extensions to JvInterpreter ====
Anonymous user