The Function Plugin Wizard allows users to create their own custom functions. The user can then use these custom functions for their reports in Strategy Desktop 9.x.
Creating a New Function
To create a new function, the user must first invoke the Function Plugin Wizard and then add a custom function. To achieve this, perform the steps in the following procedure:
Step 1: Invoking the Function Plugin Wizard
To create a skeleton Microsoft Visual C++ project for the addition of the user's specific code, perform the following steps:
- Start-up Microsoft Visual C++.
- Select 'New' from the 'File' menu.
- In the 'New' dialog box, select the 'Projects' tab.
- From the list of project types, select the Strategy Function Plug-in Wizard.
- Enter a project name. Do not use spaces in the project name as this will become the name of the library. Instead, users should name the project something short and descriptive. For illustrative purposes, the name "myFP" is used throughout the help.
- Select where this new project will be added by selecting 'Create New Workspace' or 'Add to current workspace'.
- Click 'OK'. The Function Plug-in Wizard - Step 1 of 2 - will open.
Step 2:
- Enter a Library Description. This description can contain up to 250 characters and is displayed when the library is selected during the Strategy function plug-in import process.
- Select the desired file creation option:
- If "Add all functions to a single .cpp file" is selected, all user-defined function definitions are added to the file FPFunctions.cpp.
- If "Add each function to its own .cpp file" is selected, each user-defined function is added to its own .cpp file, named <function name>.cpp.
Step 3: Adding a Function
- Under Function Information in the 'Step 1 of 2' dialog box, click 'Add' to add a function or double-click inside the function list area (not on an existing function name). The 'Add Function' dialog box will open.
- Enter the Name (without spaces) and Description (up to 250 characters) of the function.
- Under Function Mode, choose either:
- Add the parameters for the function. Users must add at least one input parameter and only one output parameter.
- Under Parameter List in the 'Add Function' dialog box, click 'Add' to add a new parameter. The wizard provides the following default values:
- The Name is set to param#’.
- The Type is set to Scalar or Vector, based on currently selected Function Mode.
- The Data Type is set to numeric.
- The Input/Output is set to Input.
- To edit a parameter value, select the cell by clicking on it or moving to it with the arrow keys and clicking F2. Make any desired changes and then complete the edit by clicking 'Enter', or clicking on another cell or button.
- To delete a parameter, select the parameter by clicking on any of its fields. The parameter which is currently selected is indicated by the marker ">>" to the left of the parameter name. Once selected, delete it by clicking 'Delete' in the 'Parameter List' area.
- If the function has properties, it will be necessary to add them to the function.
- Under the 'Property List' in the 'Add Function' dialog box, click Add to add a new property. The wizard provides the following default values:
- The Name is set to prop#’.
- The Type is set to double.
- The Default Value is set to ‘0’.
- The Description is left blank.
- To edit a property value, select the cell by clicking on it, or moving to it with the arrow keys and clicking F2. Make any desired changes and then complete the edit by clicking 'Enter' or by clicking on another cell or button.
- To delete a property, select the property by clicking on any of its fields. The currently selected property is indicated by the marker ">>" to the left of the property name. Once selected, delete it by clicking 'Delete' in the 'Property List' area.
- When finished adding parameters and properties, click 'OK'.
- Repeat this process for each function to be added.
- At anytime, if necessary, users may edit or delete any function previously added.
- Once the function definitions are complete, click 'Next' to proceed to Step #2 of the Function Plug-in Wizard. Alternatively, click 'Finish' to complete the project, if the default ATL attributes are desired.
Editing and Deleting Functions
To edit a function, select one function from the list and click 'Edit', or double-click on the desired function name. The Edit Function dialog box will open.
- Make any desired changes.
- Click 'OK'. The user is then returned to Step #1 of the Function Plug-in Wizard.
To delete a function, select one or more functions from the list and click 'Delete'.
Code Customization:
WARNING:
This customization is provided as a convenience to Strategy users and is only directly applicable to the version stated. While this code may apply to other releases directly, Strategy Technical Support makes no guarantees that the code provided will apply to any future or previous builds. In the event of a code change in future builds, Strategy Technical Support makes no guarantee that an updated version of this particular customization will be provided. In the event of a code change in future builds, Strategy may not be able to provide additional code on this matter even though this customization is provided at this time for this specific build. For enhancements to this customization or to incorporate similar functionality into other versions, contact your Account Executive to inquire about Strategy Consulting assistance.