FNEND [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation
HP Business BASIC/XL Reference Manual
FNEND
The FNEND statement defines the end of a multi-line function. A
multi-line function returns both control of the execution and a value via
a RETURN statement. The FNEND statement serves as a marker for the last
statement in the function. Therefore, an error occurs if the FNEND
statement actually executes.
Syntax
{FNEND }
{FN END}
The FNEND statement is legal only in a multi-line function. It is
illegal in the main program or a subprogram.
It is good programming practice to end a multi-line function with an
FNEND statement and use RETURN statements within the function. However,
an FNEND statement can appear more than once in a multi-line function at
either the beginning of the next subunit or at the end of the containing
program. The start of the next subunit in a program does indicate the
end of the multi-line function, but for program documentation purposes it
is a good idea to include the FNEND.
Example
10 READ A
25 DATA 3
20 C= FNMath(A) !Calls the function.
30 PRINT C
99 END
100 DEF FNMath(X) !Start of the function.
110 Y=X*2
120 RETURN Y !Return from the function.
999 FNEND !Indicates the end of the function.
MPE/iX 5.0 Documentation