Feedback

  • Contents
 

Understanding Functions

Some of the Calculation Editor dialog boxes, such as the Calculation Editor – String dialog box,  require you to have a general understanding of functions and how they work. This help topic gives a very general overview.

A function takes one or more input values and does things with them. It then hands back another value that is called its return value. A function can get input values directly, from variables, or even from other functions.

For example, suppose that you had a text string containing the name "Joe" and you wanted to add Joe's last name. You could use the Append function to do it (see figure).

You could use "Joe" as input value #1 and "Smith" as input value #2:

Append("Joe ","Smith")

The return value of the function is "Joe Smith." You could then use the function expression wherever you wanted to insert the full name.

Obviously, it's not very powerful if you use specific text strings as input values. You can also use variables and other functions as input values. If you had one variable FirstName to hold customers' first names and another variable LastName to hold their last names, you could pass the variables to the Append function and it would use whatever values were in those variables at the moment. It would return customers' full names as its return values.