Functions operate on one or more arguments and return
a single value. The returned value can be stored in a field, assigned
to a Dialogue Manager variable, used in a calculation or other processing,
or used in a selection or validation test. Functions provide a convenient
way to perform certain calculations and manipulations.
There are three types of functions:
-
Internal functions. Built
into the FOCUS language,
requiring no extra work to access or use. The following reporting
and Maintain functions are internal functions. You can not replace
any of these internal functions with your own functions of the same
name. All other functions are external.
- ABS
- ASIS
- DMY, MDY, and
YMD
- DECODE
- EDIT
- FIND
- LAST
- LOG
- LOOKUP
- MAX and MIN
- SQRT
- All Maintain-specific
functions
-
External functions. Stored
in an external library that must be accessed. When invoking these
functions, an argument specifying the output field or format of
the result is required. External functions are distributed with FOCUS.
You can replace these functions with your own functions of the same
name. However, in this case, you must set USERFNS=LOCAL.
-
Subroutines. Written
by the user and stored externally. For details, see Creating a Subroutine.
For information on how to use an internal or external function,
see Accessing and Calling a Function.