Difference between revisions of "TES5Edit Scripting Functions"
Jump to navigation
Jump to search
TES5Edit Scripting Functions (edit)
Revision as of 19:09, 16 September 2016
, 19:09, 16 September 2016→Pascal implementation: reorganized; previous list was too messy to be useful
imported>DavidJCobb (→Pascal implementation: no absolutes; there's pretty much no way to use pointers or memory tricks or anything else, well, useful) |
imported>DavidJCobb (→Pascal implementation: reorganized; previous list was too messy to be useful) |
||
Line 437: | Line 437: | ||
TES5Edit appears to use [http://jvcl.delphi-jedi.org/JvInterpreter.htm JVCL] to interpret Delphi, a variant of Pascal. A few details can be found below. | TES5Edit appears to use [http://jvcl.delphi-jedi.org/JvInterpreter.htm JVCL] to interpret Delphi, a variant of Pascal. A few details can be found below. | ||
* TES5Edit's Pascal implementation | * In TES5Edit's Pascal implementation, values are returned by assigning to <code>Result</code>, rather than by assigning to the function name. | ||
* TES5Edit's Pascal implementation does not appear to support constructions such as <code>TList<Integer></code>. | * TES5Edit's Pascal implementation does not appear to support constructions such as <code>TList<Integer></code>. | ||
* Object classes such as TList and TStringList are very primitive; methods like AddRange are missing, and their Create constructors don't accept arguments. | * Object classes such as TList and TStringList are very primitive; methods like AddRange are missing, and their Create constructors don't accept arguments. | ||
The reference documentation below appears to match what TES5Edit provides. | The reference documentation below appears to match what TES5Edit provides. | ||
* [http://docwiki.embarcadero.com/Libraries/XE8/en/System.RegularExpressionsCore.TPerlRegEx TPerlRegEx], used for regular expressions. | * [http://docwiki.embarcadero.com/Libraries/XE8/en/System.RegularExpressionsCore.TPerlRegEx TPerlRegEx], used for regular expressions. | ||
==== Broken language features ==== | |||
{|class="wikitable" width =100% | |||
!style="text-align:left;"|Feature | |||
!style="text-align:left;"|Details | |||
|- | |||
|anonymous methods | |||
|Refer to the [http://docwiki.embarcadero.com/RADStudio/XE8/en/Anonymous_Methods_in_Delphi Embarcadero documentation]. | |||
|- | |||
|array arguments | |||
|A function cannot accept an argument with a type like <code>array of integer</code>. | |||
|- | |||
|function overloading | |||
|Allows the same function to have multiple sets of arguments. | |||
|- | |||
|object types | |||
|The <code>object</code> keyword isn't implemented. | |||
|- | |||
|out parameters | |||
|Out parameters always receive default values, such as false for a boolean. Use var parameters instead. | |||
|- | |||
|procedural types | |||
|Refer to the [http://docwiki.embarcadero.com/RADStudio/XE8/en/Procedural_Types Embarcadero documentation]. | |||
|- | |||
|structured types | |||
|Refer to the [http://docwiki.embarcadero.com/RADStudio/XE8/en/Structured_Types Embarcadero documentation]. | |||
|- | |||
|subclasses | |||
|The <code>constructor</code> keyword isn't implemented. Subclasses without a constructor can be defined, but attempts to instantiate them (<code>MyClass.Create</code>) will always break. | |||
|- | |||
|try | |||
|Doesn't catch all runtime errors. | |||
|- | |||
|} | |||
==== Unsupported operators ==== | |||
{|class="wikitable" width =100% | |||
!style="text-align:left;"|Operator | |||
!style="text-align:left;"|Description | |||
|- | |||
|& | |||
|Prefix; suppresses parsing of a keyword (e.g. <code>&For</code> is a variable named "For"). | |||
|- | |||
|@ | |||
|Prefix; retrieves the address of a variable for use as a pointer; compare to <code>&</code> in C++. | |||
|- | |||
|^ | |||
|Dereferences a pointer; compare to <code>*</code> in C++. | |||
|- | |||
|<< | |||
|Used for bit shifting, but returns a junk result in xEdit. Use <code>Shl</code> instead. | |||
|- | |||
|>> | |||
|Used for bit shifting, but returns a junk result in xEdit. Use <code>Shr</code> instead. | |||
|- | |||
|} | |||
==== Unsupported keywords ==== | |||
{|class="wikitable" width =100% | |||
!style="text-align:left;"|Keyword | |||
!style="text-align:left;"|Description | |||
|- | |||
|absolute | |||
|Allows two or more variables to occupy the same location in memory. | |||
|- | |||
|as | |||
|Used to cast a variable to a given class. | |||
|- | |||
|constructor | |||
|Used to declare a constructor function for subclasses; absence of this keyword makes subclasses impossible to use. | |||
|- | |||
|is | |||
|Used to test whether a variable is an instance of a given class; for anything derived from <code>TObject</code>, you can use the <code>ClassName</code> method instead. | |||
|- | |||
|object | |||
|Used to create [http://docwiki.embarcadero.com/RADStudio/Berlin/en/Classes_and_Objects_(Delphi)#Object_Types object types]. | |||
|- | |||
|type | |||
|Partial implementation. You can use it to alias a class name, but it's broken for every single other use and its existence is therefore pointless. | |||
|- | |||
|with | |||
|Statement. | |||
|- | |||
|} | |||
==== Unsupported classes and tools ==== | |||
{|class="wikitable" width =100% | |||
!style="text-align:left;"|Feature | |||
!style="text-align:left;"|Description | |||
|- | |||
|standard libraries | |||
|Common Delphi units like DateUtils and System are unavailable. | |||
|- | |||
|[http://docwiki.embarcadero.com/RADStudio/XE2/en/Variant_Support_Routines Variant support routines] | |||
|Makes it easier to identify a variant's current type, and cast variants. Relevant type keywords like <code>varInteger</code> are also missing. | |||
|- | |||
|} |