QBasic 1.1: DEF FN Statement
Explanation
DEF FN Statement
Defines a function.
Worth knowing
Useful and cross-version information about the programming environments of QBasic, QuickBasic and Visual Basic for DOS.
Syntax
DEF FNname[(parameterlist)] = expression
DEF FNname[(parameterlist)]
[statementblock]
FNname = expression
[statementblock]
EXIT DEF]
[statementblock]
END DEF
|
Description / Parameter(s)
parameterlist |
One or more arguments in the following form: |
|
variable[( )] [AS type] [, variable[( )] [AS type]]... |
variable |
A Basic variable name. |
type |
The data type of the variable (INTEGER, LONG, SINGLE, DOUBLE, STRING, or a user-defined data type). ANY allows any data type. |
|
expression |
The return value of the function. |
The FUNCTION statement provides a better way to define a function. |