Difference between revisions of "TES5Edit Scripting Functions"

Jump to navigation Jump to search
imported>DavidJCobb
(→‎Pascal implementation: JvInterpreter chokes on reused unit names)
imported>DavidJCobb
Line 839: Line 839:
* According to Delphi documentation across the web, Const directives inside of functions and procedures are supposed to define static local variables: these variables are not supposed to be constants, and their values are supposed to persist until the script has finished executing. However, in JvInterpreter, Const directives in functions and procedures just define ordinary local variables, whose values will be lost the instant the function or procedure finishes executing. Among other things, this means you can't use getters with static variables to work around the issues with global variables.
* According to Delphi documentation across the web, Const directives inside of functions and procedures are supposed to define static local variables: these variables are not supposed to be constants, and their values are supposed to persist until the script has finished executing. However, in JvInterpreter, Const directives in functions and procedures just define ordinary local variables, whose values will be lost the instant the function or procedure finishes executing. Among other things, this means you can't use getters with static variables to work around the issues with global variables.
* The scripting environment will not throw errors upon encountering the <code>interface</code> or <code>implementation</code> keywords, but it also does not honor them: definitions within the implementation will be available to a file's users. It appears that these keywords are purely semantic.
* The scripting environment will not throw errors upon encountering the <code>interface</code> or <code>implementation</code> keywords, but it also does not honor them: definitions within the implementation will be available to a file's users. It appears that these keywords are purely semantic.
** JvInterpreter does not throw errors if you redefine a function within the same file, even if the redefinition changes that function's signature; it simply uses the last definition.
** JvInterpreter may encounter parser errors if it finds a forward-declared function or procedure, owing to the lack of Begin and End keywords.
** JvInterpreter does not throw errors if you redefine a function within the same file, even if the redefinition changes that function's signature. Sometimes, it uses the last definition; other times, however, it uses the first definition.
* 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.


Anonymous user

Navigation menu