Difference between revisions of "TES5Edit Scripting Functions"

527 bytes removed ,  00:56, 16 September 2016
→‎Pascal implementation: You actually can use TFileStream, but it's not intuitive. Use TStringList.SaveToStream, then decrease stream Size by 2 to remove unwanted CRLF.
imported>DavidJCobb
(→‎Pascal implementation: no TFile either)
imported>DavidJCobb
(→‎Pascal implementation: You actually can use TFileStream, but it's not intuitive. Use TStringList.SaveToStream, then decrease stream Size by 2 to remove unwanted CRLF.)
Line 460: Line 460:
* TES5Edit's Pascal implementation supports out parameters but does not handle them properly. It appears as though they always receive default values (e.g. false booleans, empty strings). Var parameters properly receive values.
* TES5Edit's Pascal implementation supports out parameters but does not handle them properly. It appears as though they always receive default values (e.g. false booleans, empty strings). Var parameters properly receive values.
* TES5Edit's Pascal implementation, while allowing you to use the << and >> operators for bitshifting, will result in values of FFFFFFFFFFFFFFFF or 0 instead an actual result. Use the shr and shl operators instead to perform working bitshifting. `FormID shr 24` for load order, etc.
* TES5Edit's Pascal implementation, while allowing you to use the << and >> operators for bitshifting, will result in values of FFFFFFFFFFFFFFFF or 0 instead an actual result. Use the shr and shl operators instead to perform working bitshifting. `FormID shr 24` for load order, etc.
* Though the class can be instantiated, it is impossible to actually use <code>TFileStream</code> properly in TES5Edit, due to the lack of support for pointers and for related classes like <code>TWriter</code>. Non-class-based methods like <code>AssignFile</code> aren't implemented, and the <code>TFile</code> class isn't implemented. It appears that the only way to write files is through <code>TStringList</code>, which always appends a CRLF to the end of a file and is therefore totally unsuitable for writing binary data.


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.
Anonymous user