Commodore 128 System Manual page 262

Table of Contents

Advertisement

This statement closes a single file or all the files currently open
on a disk unit. If no logical file number is specified, all currently
open files are closed. The default device number is 8. Note the
following examples:
EXAMPLES:
DCLOSE
Closes all files currently open on unit 8.
DCLOSE #2
Closes the file associated with the logical file number 2.
DCLOSE ON U9
Closes all files currently open on unit 9.
DEF FN
Return the value of a user-defined function
DEF FN name (variable) = expression
This statement allows definition of a complex calculation as a
function, ln the case of a long formula that is used several times
within a program, this keyword can save valuable program space.
The name given to the function begins with the letters FN,
followed by any legal numeric variable name (not integer or
array). First, define the function by using the statement DEF,
followed by the name given to the function. Following the name is
a set of parentheses () with a local numeric variable name
enclosed. This variable only has a value if it appears in the
expression to the right of the equals sign. The same variable
name can be used elsewhere in a program but it will be
completely separate from its use in the function. Other variables
and/or functions can be used in the expression and these are
evaluated as their value at the time the function is called. Next is
an equal sign, followed by the formula to be defined. The function
can be performed by substituting any number for X, using the
format shown in lines 40 and 50 of the example below:
17-20

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

128d

Table of Contents