New PascalScript Language support added. Unlike the previously MS ActiveScripting based languages this is a 100% native VCL implementation without need of external dlls. The PascalScript engine includes an optimizing byte code compiler and very fast interpreter. The PascalScript language is a dynamic Variant based script language that supports most of the Delphi Pascal expressions and statements likeÃ‚Â
New three step initialization of ScriptPack Control. New Prepare, Open and Close methods and a State property was added. In addition the new ‘Prepared’ intermediate state was introduced. In this state all source code is already parsed, but no global code is executed yet (CodeObject is already acessible in this state). This new feature allows circular dependencies between script controls even in case when global code is used (hence handling several scripts at the same time is simplified enormously). In simple cases a call to Prepare method can be ommitted. Finally the ACloseOnRuntimeError parameter was added to the Open method to allow leaving script control opened in the case that runtime errors occured during global code execution.
New exception handling replaces Last ScriptError concept. Script control includes now the encoded source (reference to script control), error line and position information in exception messages (e.g. in string form). The LMDDecodeErrorMessageInfo procedure allows to decode this information for advanced applications.
New optimized Delphi memory manager proxy allows to detect finalized object destructions. E.g. all subsequent access to IDispatch object wrapper will report ‘Object has been destroyed’ exceptions instead of unsafe Access Violations. This feauture is especially used by working with exceptions in PascalScript, because exception objects are automatically destroyed by the interpreter.
New prepared expressions/statements feature was added to optimize Eval and ExecuteStatement methods. If the same expression/statement need to be executed many times then it is more efficient to Prepare it first and then use Eval and ExecuteStatement overloadeds methods that take prepared objects as parameters. Note: Most speed gain will be seen in native PascalScript implementation, because all other ActiveX script implementations do not support this feature internally.
New Create constructor and Copy method are implicitly generated in wrappers for Delphi record types to allow creating and copying records more naturally.