[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
DEF FN                   Define Function

 1. DEF FNname[(parmlist)] = expression

 2. DEF FNname[(parmlist)]
    .
    . [statements]
    .
    [EXIT DEF]
    FNname = expression
    END DEF

    Defines a user function.

        name    A valid variable name, of the same type as expression.

    parmlist    One or more formal parameters for the function. Each must
                be a valid variable name. Parameters are passed by value.

  expression    An expression, of the same type as name, that defines the
                value returned by the function.

   ----------------------------------------------------------------------

      Notes:    For numeric functions, the precision specified by name
                determines the precision returned by the function.

                Functions must be defined before they are called. They may
                not be defined within IF/THEN/ELSE, FOR/NEXT, WHILE/WEND,
                or SUB/END SUB blocks, and they may not be defined in
                terms of themselves.

                In the multi-line syntax, expression defines the value
                returned by the function. The optional EXIT DEF statement
                can be used to exit the function but does not define the
                end of the function.

                Variables in a multiline function definition are global
                unless declared in a STATIC statement.

See Also: STATIC
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson