Investment Studio > Views > Macros > Overview

The following screenshot highlights the key features of the Macros view:

The combo box in the upper left corner shows the selected ActiveX Scripting engine. Any macro call in any expression throughout Investment Studio is executed using this engine.

Click the spin button to get a drop-down list of all available engines; select a different entry in the list to switch engine.

The list below the engine combo box displays the names of all macro packages associated with the selected engine.

If a package is active (checked in the list) its contents are loaded and available for execution. When a package is selected in the list, the package file can also be edited in the editor panel (3).

The package list can also be used to sort, find, create, copy, rename and delete packages. See the section on managing packages for details.

The list can be horizontally resized by dragging the empty space which separates it from the editor panel.

When a package is selected in the list (in the picture above, "resynth") the editor panel contains two tabbed pages.

The contents of the selected package can be edited in the first page. The corresponding tab shows the name of the package file, including the filename extension (in the picture above, "resynth.vbs"). If the file has been modified since it was last saved, the filename is followed by an asterisk (as in "resynth.vbs*"). Edits are automatically saved (and the modified file loaded into the selected engine, if the package is active) whenever this page loses input focus.

The second page (or the only one, when no package file is selected) displays the contents of all active packages, in engine load order. This page is read only.

The editor panel's status bar serves dual purposes: it displays information about the visible editor page (the current cursor position in row:column form, whether you are inserting or overwriting) and about the selected engine (whether it's connected, i.e. accepting calls from Investment Studio, and what it's doing, e.g. waiting idly for new macro calls).

The editor panel can be vertically resized by dragging the empty space just below the status bar.

The editor panel's pop-up menu (opened by right-clicking the editor) also serves dual purposes: it gives you access to the same editing functions found in ordinary Notes objects (Edit and Search submenus) and adds engine-specific functions (Setup > Engines submenu).

The engine-specific section lets you add, delete and modify engine records. You can also use Reset to force a malfunctioning engine to re-initialize.

See the section on managing engines for details.

The lower right portion of the Macros view contains a simple spreadsheet which can be used to test macros and built-in functions. If you edit an active macro, the modified code becomes available for execution as soon as the editor loses input focus (e.g. when you select a cell in the spreadsheet). The spreadsheet is then automatically recalculated.

To enter a cell value, use the cell's in-place editor. To enter a cell expression, select the cell, make sure that its data type is not Empty (use the cell type box in the spreadsheet's upper left corner, number 7 in the screenshot), then enter the expression in the edit box above the cell grid (number 8 in the screenshot).

See the section on testing macros and built-in functions for details.

The combo box in the spreadsheet's upper left corner shows the data type of the selected cell. Click the spin button to get a drop-down list of all available data types; select a different entry in the list to change the data type of all cells in the selected cell range.
The edit box above the grid is used to edit cell expressions. Before entering a new expression, make sure that the selected cell's data type is not set to Empty (use the cell type box in the spreadsheet's upper left corner, number 7 in the screenshot). Hit Enter, doubleclick the edit box or simply exit it to commit to the new expression; hit Esc to discard it and revert to the previous expression.