
231
User-defined BASIC Functions
Section 7-7
7-7
User-defined BASIC Functions
User-defined BASIC functions are expressions created by the user in BASIC
and saved as user-defined functions. Other BASIC functions can be called up
and executed by their specified function name in the same way. Function
names, input variables, and expressions are declared using BASIC’s DEF FN
command.
User-defined BASIC
Function Procedure
1,2,3...
1.
Declare the following details using the DEF FN command.
• BASIC function call name
• Variable name input to the BASIC function
• Expression
2.
Execute the program using the BASIC function name.
User-defined BASIC
Function Definition
(DEF FN)
Syntax
DEF FN
function_name
(
variable_name
[,
variable_name
]) =
expression
Meaning
DEF FN declares a user-defined BASIC function. It sets the function name
(same restrictions as for variable names) and the variable names for input to
functions (more than one name is possible), and the expression.
Example:
BASIC Function Calls
As for other functions, used-defined functions are called by specifying the
function name and then the variable(s) within parentheses.
Example:
C = FNABC (A,B)
Note
Text strings starting with reserved words cannot be used for function names.
The following characters cannot be used at the end of function names: $ % &
! #
Expression
Function name
DEF FNABC (A,B) = A+B
Variable
Summary of Contents for C200H-ASC11
Page 1: ...C200H ASC11 ASC21 ASC31 ASCII Units Operation Manual Revised June 2000...
Page 2: ...iv...
Page 4: ...vi...