Lesson Summary

This chapter introduced you to the concept of Functions, which are powerful tools for converting zero or more input values (or Arguments) into calculated results. You include functions in your expressions by writing the function’s name followed by a set of brackets containing all necessary arguments. For example:

"The sum of 6 and 4 is " & Sum( 6, 4 );

Many standard operators have function equivalents, which helps you to keep your code tidier than filling it with several operators in a row, and avoiding the need to override operator precedence.

Functions can be combined to produce more complex expressions, such as concatenating the results of multiple arithmetic functions. This is known as function Nesting, an example of which is shown below:

Sum( Mod( 16, 7 ), Mod( 8, 3 ) );

In the above example, the modulus of 16 and 7 (2) is added to the modulus of 8 and 3 (2), producing a value of 4.

 

<< Previous: Nesting Functions | Next: Test Your Knowledge! >>