Functions can be used in all three calculators in ILWIS: MapCalc, in TabCalc, in scripts or in the pocket line calculator. Some 50 internal functions are available (see also MapCalc and TabCalc), but also user-defined functions can be created.
A user-defined function generally contains of a combination of:
To create a user-defined function:
A user-defined function can be created:
Dialog box options:
Function name: |
Type a new name for the user-defined function. |
Expression: |
Type the expression that the function should perform. An expression is a combination of user-defined parameter names with which you want to calculate and some MapCalc and TabCalc operators and functions. Parameter names:
|
Description: |
Type a description for the user-defined function. The description is visible on the status bar of the Main window when moving the mouse pointer over the function in the Catalog. |
The Function editor is opened. For more information on function syntax, see Function editor : functionality.
Example:
newcol = sumcols(January,February)
newcol2 = sumcols(March,April)
In Map calculation : creating and applying user-defined functions and in Table calculation : creating and applying user-defined functions other 'basic' examples are available.
For more advanced user-defined functions, e.g. user-defined functions with IF, THEN, ELSE loops, FOR loops, WHILE loops and REPEAT/UNTIL loops, see Map and Table calculation : User-defined functions (advanced).
Tips:
See also:
Function editor : functionality
Map calculation : creating and applying user-defined functions
Table calculation : creating and applying user-defined functions
Map and Table calculation : user-defined functions (advanced)