Please enable JavaScript to view this site.

Altova MapForce 2020 Professional Edition

Functions > User-Defined Functions

Inline and Regular User-Defined Functions

Scroll Home Prev Top Next More

There are two kinds of user-defined functions: inline and regular. You can specify whether a function should be inline or regular when creating the function, see Creating User-Defined Functions. Inline and regular functions behave differently in terms of code generation, recursiveness, and the ability to have multiple output parameters.


Inline functions

Regular functions

Inline functions are extracted in all instances where they occur in generated code, which makes the code longer but also slightly faster.


Note that inline functions can significantly increase the amount of generated program code. The user-defined function code is actually inserted at all locations where the function is called, and thus increases the code size substantially - as opposed to using a regular function.

Each user-defined function component generates code for a function call, where inputs are passed as parameters, and the output is the function (component) return value.


At runtime, all the input parameter values are evaluated first, and then the function is called for each occurrence of the input data.

Inline functions can have multiple outputs and thus return multiple values.

Regular functions can have only one output. To return multiple values, you can declare the output to be of complex type (for example, XML structure), which would allow you to pass multiple values to the caller.

Inline functions cannot be called recursively.

Regular functions can be called recursively.

Inline functions do not support setting a priority context on a parameter.

Regular functions support setting a priority context on a parameter.


Switching a user-defined function from "inline" to "regular", or vice versa, may affect the mapping context, and this may cause the mapping to produce a different result.


On the mapping, inline user-defined functions are displayed with a dashed border. For example, the middle component in the mapping below is an inline user-defined function.


Regular functions are displayed with a solid border. For example, the middle component in the mapping below is a regular user-defined function.


© 2020 Altova GmbH