Inserting Code Elements into a Formula

23.08.2021

For all common elements that you use to construct your formula, FlexPro offers wizards that free you from a large part of the coding workload. Under Formula Tools/Design[Insert FPScript] you will find wizards for inserting functions, object properties, operators, constants, statements, data sets and index operations.

Inserting a Function

1.Place the cursor at the position where you would like to insert a function.

2.Click Formula Tools/Design[Insert FPScript] > Function or press CTRL+SPACE to view a list of available functions.

3.Select the desired function from the list and press ENTER to insert it into the formula.

4.The FlexPro Assistance Window will then appear, which will assist you in entering the function arguments. Another list appears for data arguments that contains data sets in the folder of the formula whose data structure is valid for the argument. For arguments requiring a constant, a corresponding list appears with the valid constants. Use the UP key to switch to the list and to select an entry.

5.After selecting an argument, add a comma, if applicable, to enter additional arguments.

Note: To view the Assistant Window for the argument at a later time, place the cursor on the argument and press SHIFT+CTRL+SPACE.

Inserting an Object Property

a) Using the Formula Editor's Assistance function

1.Next, specify the object by entering one of the keywords This, ThisFpObject, ThisObject or Application or an object reference, such as '\2D-Diagram.2D'.

2.Now enter a period to view the list of available properties.

3.Use the DOWN key to switch to the list and to select an item from the list. Transfer the item using the ENTER key.

b) Using the Object Properties Wizard

1.Click on the position where you would like to insert an object property.

2.Click Formula Tools/Design[Insert FPScript] > Object Property.

3.A wizard appears to assist you with the remaining steps.

Inserting a Unit Symbol

1.Click on the position where you would like to insert a unit symbol.

2.Click Formula Tools/Design[Insert FPScript] > Unit Symbol.

3.In the dialog box, select either the required unit symbol directly or first select the physical quantity and then the appropriate unit symbol.

4.Click OK to confirm and apply your selection.

Inserting Data Sets from the Object List

Data sets, formulas and analysis objects that you want to use for the formula calculations can be transferred from the Object List into the formula. Simply drag the desired data set with the mouse from the Object List to the position in the formula where the reference is to be inserted. A reference to the object is then placed in the formula. If the inserted object is located in the same folder or in an activated subfolder, only the name is entered. Otherwise, the path name of the object is entered. The object has to be located in the same project database as the formula. You can also drag a cell range selected in the data view of a folder or a data set window into the formula. An FPScript expression is then inserted that extracts the selected section from the data set.

See Also

Formula

Share article or send as email:

You might be interested in these articles