Feature: Named function parameters

Function parameters can now be named, making formulas easier to read. Named parameters can also make formulas significantly shorter.

Some of Calcapp’s formula functions accept a large number of parameters, which can make formulas hard to read. Our new release includes support for named parameters, allowing you to precede a parameter value with its name, followed by : and a space.

For instance, these two formulas are now equivalent:

FORMATNUMBER(23, 2, 2, FALSE, 1, FALSE, "$")FORMATNUMBER(23; 2; 2; FALSE; 1; FALSE; "$")
FORMATNUMBER(Number: 23, MinimumNumberOfDecimalPlaces: 2, MaximumNumberOfDecimalPlaces: 2, OmitThousandsSeparators: FALSE, MinimumNumberOfIntegerDigits: 1, UseAccountingStyle: FALSE, LeadingUnit: "$")FORMATNUMBER(Number: 23; MinimumNumberOfDecimalPlaces: 2; MaximumNumberOfDecimalPlaces: 2; OmitThousandsSeparators: FALSE; MinimumNumberOfIntegerDigits: 1; UseAccountingStyle: FALSE; LeadingUnit: "$")

All parameters don’t need to be named, but once a parameter has been named, the remaining parameters must also be named.

Named parameters make it possible to provide parameters out-of-order and to omit optional parameters that normally would have been expected to precede a parameter, had it not been named. Omitted optional parameters use default values.

The formula above happens to use default values for all parameters other than Number and LeadingUnit. As such, those optional parameters can be removed from the formula.

To put that into practice, consider this formula:

FORMATNUMBER(23, LeadingUnit: "$")FORMATNUMBER(23; LeadingUnit: "$")

The delightfully-short formula above is fully equivalent to the first two formulas.

We suggest that you use named parameters when they help make a formula easier to read.

We added named parameters to Calcapp to make existing functions like FORMATNUMBER easier to use, but also in consideration of new functions like EMAILREPORT and OPENREPORT. Those functions support a very large number of optional parameters, and named parameters enable you to only provide the parameters you care about, omitting the rest.

To learn the names of the parameters to formula functions, use our formula documentation. Also, all parameter names are part of our new autocomplete feature, making them easy to insert.

Colons in ranges versus colons used for named parameters

: is also used in formulas to create ranges, like Field1:Field4Field1:Field4, which often expands to { Field1, Field2, Field3, Field4 }{ Field1; Field2; Field3; Field4 }. Previously, you could write : with space either to the left or to the right. Now, however, Calcapp will interpret : with a space to the right as an attempt to name a parameter.

As part of our automatic migration process, we have changed all formulas with ambiguous : characters, so that they are always interpreted as being part of ranges.

« Our next release and upcoming subscription changes Feature: Easily decide the next screen »