Script Editor

Thursday, 23 February 2023 by Gavin Huet

This blog introduces finPOWER Connect developers to the new Script Editor in version 4.

finPOWER Connect version 4 introduced an updated Script Editor that uses the latest scripting components from the Actipro library.

The updated Script Editor has many advantages, such as increased performance and enhanced intellisense integration, and a lot of built in functionality has been rewritten to make use of these advantages.

The updated Script Editor has implemented new features to make coding even easier for developers:

There are some visual changes to the new Script Editor such as the new Function Explorer on the right hand side and the font size button on the bottom toolbar.

Going into Edit Mode is now immediate and there is more intellisense support.

Overview of Script Editor

Intellisense

Scripting intellisense has been updated to include external references and function libraries.

External references can be specified in two ways in the script:

  #Reference Newtonsoft.Json.dll
  #Reference "C:\Temp\Newtonsoft.Json.dll"

Once you save these changes the external reference library will be loaded and available for intellisense, which will appear automatically as you type, for example:

  Newtonsoft.

Intellisense external reference

Function libraries can be specified in the script:

  #INCLUDE "LIBSTRING"

Intellisese library definition

Once the script is saved the function library methods will appear in the Function Explorer and also in the intellisense.

Intellisense library

Business Layer Help

Pressing Alt+F1 activates the Business Layer Help, and this has been enhanced to navigate to the Microsoft Help pages in MSDN for .NET functionality.

In the example below the cursor is on the String.Format function when Business Layer Help is activated.

MSN Help

The Microsoft MSDN page for the String.Format function will open in the default browser.

MSDN help result

Comparing scripts

The Script Editor compare panel functionality has been enhanced to allow more paste options via the right-click context menu:

  • Template Script Code
  • Code Snippets
  • Built in scripts, such as Credit Enquiries
  • Standard Block code

Compare Panel paste options

There are also new buttons to clear the Compare panel, and to allow you to move code from one panel to another, or to swap the content of the two panels.

Compare Panel

Viewing differences between scripts

The algorithm used to display the differences between two versions of a script has been updated.

The resulting visual representation of the differences is generated quicker and is easier to read.

When you insert an expanded script, such as a Credit Enquiry Report, into the Script Editor you will automatically be shown the differences between the built in script and the one currently in the Script Editor thereby making it easy to identify changes in either version.

Difference viewer

Font enhancements

You now have the ability to change the font size via the button strip at the bottom of the Script Editor.

This can be particularly useful in demonstrations or screen sharing scenarios.

Font size options

Changing the Script Editor font size does not affect any of the other controls.

Font size set to 150%

You can also change the default font and default font size via settings located in Tools, User Preferences, Developer, General page.

The ability to change the font size is always relative to the default font size.

Function Explorer

The Function Explorer on the right hand side of the Script Editor has been rewritten to work with both Visual Basic and C#.

You can type into the filter box to limit displayed items to specific methods.

The Function Explorer also displays method comments as a tooltip when you hover over the method name, and will be kept in sync as you move through your code.

Method Explorer tooltips

There is also a right-click context menu option "Go To Definition" that will allow you to go to where the highlighted method is defined in your script.

Go to definition