Navigation:  OVERVIEW > 2.3 NAMESPACES >

2.3.12 ManagingEnergy Scripting Namespace

Previous page Next page
  rev. 2010-10-07        

The ManagingEnergy.Scripting namespace contains objects which assist in executing scripts used by formula components during dynamic value calculations. The ScriptExecuter currently supports both VBScript and JavaScript.

SCRIPT Compatibility

The ScriptExecuter uses Microsoft’s Script Control to evaluate the formula equations. This control supports VBScript and JavaScript; however it does not support VBA. As a result a number of compatibility issues have been detected.

No Support for Optional Arguments

Optional arguments are not supported in VBScript. The solution to this problem is to remove the optional arguments from the VBA methods (as shown below)

Public Function DaysInPeriod(dtSDate As Date, dtEdate As Date, dtPeriodStart As Date, dtPeriodEnd As Date, Optional bPercentageReturn As Boolean, Optional bYearSpecific As Boolean)

… changed to …

Public Function DaysInPeriod(dtSDate As Date, dtEdate As Date, dtPeriodStart As Date, dtPeriodEnd As Date, bPercentageReturn As Boolean, bYearSpecific As Boolean)

 

Single/Double Quoted Strings

VBScript does not appear to support single quoted strings. An initial investigation suggests that this will only affect formulas involving the DateDiff function. Due to the limited scope of this issue, a simple string replace (single quotes with their double quote counterpart) is applied to the formula prior to evaluation.



2.3.12_ME_Scripting_Namespace         ©2017 Managing Energy Inc.