Def,Fnend,Return; Single Line Function; Multiline Function - IBM 5100 Basic Reference Manual

Hide thumbs Also See for 5100:
Table of Contents

Advertisement

DEF FNfunction-name [(arith-var [,arith-varl ..
.l J
[=arith-exp]
64
FNEND [comment]
RETURN [arith-exp]
OEF, FNENO, RETURN
The DEF statement is not executable. but informational. This statement allows the
user to define an arithmetic function for use later in the program. The FNEND state·
ment indicates the end of the function. and the RETURN statement specifies the
value of the function. The syntax of the DE!= statement can be either a single line
or multiline function. (The syntax of the FNEND and RETURN statements are
shown after the DEF statement syntax.)
Single Line Function
DEF FNfunction-name [(arith-var [,arith-var] ... ] [=arith-exp]
where:
function-name
is any character of the extended BASIC alphabet. This character
with FN is the name of the defined function.
(arith-var)
is one or more simple arithmetic variables to which a value will be assigned
when the function is called (these must be enclosed in parentheses).
arith-exp
is an arithmetic expression that can be invoked by reference in another
statement during program execution. A sample single line function DEF state·
ment is as shown:
120 DEF FNA(R)=2*R+100
Multiline Function
DE F FNfunction-name [(arith.var [,arith·varl ... ) ] [=arith·exp]
where:
function-name
is any character of the extended BASIC alphabet. This character
with FN is the name of the function.
(arith-var)
is one or more simple arithmetic variables that receive a value when the
function is referenced. These optional variables must be enclosed in parentheses.
/

Advertisement

Table of Contents
loading

Table of Contents