Like the simple scripts introduced in the previous section, EASI programs are stored in text files with upper-case names ending with the extension ".EAS". These files may be created with any text editor. In fact, there is no difference between the EASI scripts from the previous section and the more powerful programs described here, except that these programs draw upon the full set of EASI commands. It is possible for an EASI script to call another EASI script, providing subroutine type capability, and for an EASI script to call itself, providing recursion. However, EASI scripts are limited in that there is no direct way to pass data to them nor for them to return a value, except through setting EASI parameters and manipulating external data files. However, EASI allows the definition of functions, which are similar to scripts but which may be called with a list of arguments, and which are able to return a specified value. The definition of a function is done within an EASI script. In other words, functions are defined in text files with the same naming conventions as EASI scripts. Functions are not normally defined interactively at the command line.
An example of an EASI function definition is:
! file USERFUNC.EAS ! function to compute the average of two values DEFINE FUNCTION Average ( x, y ) return ( (x+y)/2 ) ENDDEFINE
The statements within the body of the function are executed when the function is called:
EASI>load "USERFUNC.EAS" EASI>print Average( 4, 6 ) 5
Notice how we need to use the LOAD command to load the script before executing functions defined by it.
Note: a function should not have the same name as the script in which it is defined, for example a function named "test" should not be defined in a file called TEST.EAS. Details on defining and using functions will be presented in a later section.
There are a number of special built-in functions available in EASI, which are known as intrinsic functions. These special functions provide a number of important capabilities, such as common numeric computations, and file access.
An example of a simple numeric function is COS(), which returns the cosine of an angle in radians:
EASI>print cos(0.5) 0.877583
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.