
DEF FN<name>[«parameter
list»]=<function
definition>
SK, Extended, Disk
To define and name a function that is written by
theuser.
<name> must be
a
legal
variable
name.
This
name,
preceded
by
FN, becomes the name of the
function.
<parameter
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.
<function definition> is an
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.
Содержание Basic Interpreter Basic 80
Страница 1: ...5IA iC intc tit tcl c t ...
Страница 2: ......
Страница 6: ... ...
Страница 10: ......
Страница 26: ......
Страница 33: ...2 5 Intentially left blank ...
Страница 37: ...BASIC SO COMMANDS AND STATEMENTS 2 9 Intentially left blank ...
Страница 40: ...410 DEF FNAB X Y XA3 YA2 420 T FNAB I J Line 410 de ines the function function is called in line 420 ...
Страница 112: ......
Страница 136: ......
Страница 140: ......
Страница 160: ......
Страница 165: ......
Страница 166: ......
Страница 174: ......
Страница 176: ......
Страница 182: ......
Страница 184: ......
Страница 190: ......