Vector Basic Interpreter Basic 80 Reference Manual - page 39
DEF FN
list»]= definition> SK, Extended, Disk To define and name a function that is written by theuser. a legal variable name. This name, preceded by FN, becomes the name of the function. list> is comprised of those variable names in the function definition that are to be replaced when the function is called. The items in the list are separated by commas. expression that performs the operation of the function. It is limited to one line. Variable names that appear in this expression serve only to define the function: they do not affect program variables that have the same name. A variable name used in a function definition mayor may not appear in the parameter list. If it does, the value of the parameter is supplied when the function is called. Otherwise, the current value of the variable is used. The variables in the parameter list represent, on a one-to-one basis, the argument variables or values that will be given in the function call. (Remember, in the SK version only one argument is allowed in a function call, therefore the DEF FN statement will contain only one variable.) In Extended and Disk BASIC-SO, user-defined functions may be numeric or string: in SK, user-defined string functions are not allowed. If a type is specified in the function name, the value of the expression is forced to that type before it is returned to the calling statement. If a type is specified in the function name and the argument type does not match, a "Type mismatch" error occurs. A DEF FN statement must be executed before the function it defines may be called. If a function is called before it has been defined, an "Undefined user function" error occurs. DEF FN is illegal in the direct mode.