Investment Studio > Views > Macros > Managing engines

Selecting an ActiveX Scripting engine

Investment Studio uses a single instance of the selected ActiveX Scripting engine to execute all macros in all expressions, irrespective of their location.

To tell Investment Studio which engine to use, locate the combo box in the upper left corner of the Macros view,

click its spin button to expand the list of available engines,

and click the engine of choice. When a new engine is selected, Investment Studio will:

stop, disconnect and terminate the previous engine instance;
update the list (under the engine combo box) of macro packages associated with the selected engine;
load all listed macro packages which are marked as active (i.e. checked in the package list);
display the contents of all loaded packages in the editor panel (under "Active macros");
create a new instance of the selected engine, with all active packages loaded; and
connect to the new instance of the selected engine.

The entire process shouldn't take more than a few seconds. When the mouse cursor reverts from busy (hourglass) to normal, look at editor panel's status bar for confirmation that the new engine is connected.

The recommended macro engine is VBScript. This is because VBScript supports OLE arrays, which can be used to receive array arguments from and return array results to Investment Studio. Unlike VBScript, JScript does not support OLE arrays.

Adding and deleting ActiveX Scripting engines

Investment Studio keeps a separate record for each ActiveX Scripting engine available to it. Engine records contain engine-specific information (engine name, associated filename extensions, syntax highlighting conventions etc.).

Since Windows ships with JScript and VBScript engines already installed, Investment Studio starts off with default records for JScript and VBScript. If you install additional ActiveX Scripting engines on your Windows system, you can make them available to Investment Studio by creating records for them, too. This is done from the editor panel's pop-up menu:

To create a new engine record, click Add. This will take you to the Add engine dialog. If you change your mind later about some setting entered in this dialog, click Edit. This will open the Edit engine record dialog.

You can also Delete the record for the selected engine. You will be asked for confirmation before this command is executed.

Delete is a dangerous command. Once an engine's record has been deleted, the engine is no longer available anywhere in Investment Studio; any expression depending on it for macro execution will no longer work. Also, all settings for the engine (associated filename extensions, syntax highlighting etc.) will be permanently lost.

Note that deleting an engine record does not cause the engine to be uninstalled from Windows. It just causes Investment Studio to forget all about it.

Modifying engine-specific properties

The editor panel's pop-up menu contains two entries which you can use to modify engine-specific properties:

Setup > Engines > Edit opens the Edit engine record dialog. Use this dialog to associate the currently selected record with a different engine, to modify the engine name displayed in the user interface (e.g. in the combo box in the upper left corner of the Macros view) and to modify the filename extensions associated with the engine.
Setup > Engines > Fonts is used to set up syntax highlighting for the selected engine:

Clicking any of the entries in the Fonts submenu will open a standard Windows font dialog, where you can specify how the editor should display the corresponding code elements.

Note that not all ActiveX Scripting engines support this feature. Since the editor is language-neutral, it must rely on the engine to tell it what's an operator, what's a constant and so on, and not all engines provide this information.

If an operation causes the selected engine to malfunction (e.g. resulting in erratic syntax highlighting) try using Setup > Engines > Reset.