Functional Operators
A function is used in an expression to call a predetermined operation to be
performed on an operand. For example, SQR is a function used twice in the
following assignment statement:
A = SQR (20.25) + SQR (37)
BASIC incorporates two kinds of functions: intrinsic and user-defined.
- Many predefined (intrinsic) functions are built into the language.
Examples are the SQR (square root) and SIN (sine) functions.
- You may define your own functions with the FUNCTION...END FUNCTION
construction and the older, obsolete DEF FN...END DEF construction.
Such functions are defined only for the life of the program (unless
they are in a Quick library) and are not part of the BASIC language.
In addition to FUNCTION and DEF FN, BASIC allows you to define subprograms
with SUB.