About Functional Expressions

About Functional Expressions

Welcome to our Knowledge Base

Documentation | Blog | Demos | Support

< All Topics
Print

About Functional Expressions

The software provides a host of built-in functions that process given arguments in a variety of ways. An expression consisting of a function and its arguments (typically, value expressions) is called a functional expression.

Examples of functional expressions are

$length(‘Smith’)

Evaluates to 5

$cos(0)

Evaluates to 1

$log10(2*50)

Evaluates to 2

$year(19990923)

Evaluates to 1999

$maxof($absolute(-10),4+5)

Evaluates to 10

General Performance

Functions are a special class of operator, but they perform much like arithmetic operators; they take one or more given values, perform an operation using those values, and return a result. The value of the result depends on the function.

The function’s arguments are similar to the arithmetic operands. Like arithmetic operands, the arguments can consist of literals or value expressions, including other functional and arithmetic expressions as shown in the following example:

$absolute(-7)

The functional expression shown above consists of the argument -7 and the function keyword $absolute. The function $absolute returns the absolute (i.e., unsigned) value of its argument (in this case, 7).

Complex Arguments

If the argument is a complex expression, the argument is evaluated before the function is applied. For example, in the expression

$absolute(6-11)

the arithmetic expression 6-11 is evaluated first, yielding $absolute(-5). Then the final result (5) is determined.

Functional expressions can act as arguments to other functions. For example, the expression

$toupper($substring(‘abcdef’,2,3))

evaluates to

$toupper(‘bcd’)

which in turn evaluates to

‘BCD’

Data Type of Arguments and Results

Each function expects arguments of a certain data type; however, the function accepts arguments of any data type and appropriately converts any argument that does not conform to the expected type.

Related Information

About Data Types

Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.

Leave a Reply

Your email address will not be published. Required fields are marked *

en_CAEnglish