EasyManuals Logo

IBM 5100 Basic Reference Manual

IBM 5100
187 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #69 background imageLoading...
Page #69 background image
(
(
(
(
(
RETURN
[arith-exp]
where:
arith-exp
is
an arithmetic expression
that
specifies
the
value
of
the
user-defined
function
to
the referencing function.
FNEND
[comment]
The FNEND statement
is
nonexecutable and simply indicates
the
end
of
a multiline
function. The value of
the
function
is
specified
in
an arithmetic expression
in
a
RETURN statement. The
comment
is
optional.
When a reference
to
a user-defined function
is
encountered during program execution,
the
value
of
each parameter
in
the
expression
is
used
to
initialize
the
corresponding
variable. The optional variables must be arithmetic and must match the number
specified
in
the
function reference.
If
the
expression
is
present,
the
function
is
defined
on
the
one line and its value
is
the
value
of
that
expression. This
is
a single line func-
tion.
If
the
expression
is
not
specified,
the
DEF statement
is
the start
of
a multiline
function.
In
this case, the FNEND statement indicates
the
end
of
the
function and
the value of
the
function
is
specified
in
an arithmetic expression
in
a RETURN
statement.
Notes
About
DEF
A function can be defined anywhere
in
a BASIC program, either before
or
after
it
is
referenced.
A function
of
a given name can be defined only once
in
a given program.
A function cannot contain references
to
itself or
to
other
functions
that
refer
to
it
in
their definitions.
The expression
in
the
RETURN statement
is
required for multiline functions
(see
GOSUB and RETURN).
A function reference
to
a user-defined function can appear anywhere
in
a BASIC
expression
that
a constant, variable, subscripted array element reference,
or
system
function reference can appear.
The arithmetic variables have a special meaning
in
the DEF statement. Conse-
quently, it
is
possible
to
have a variable with the same name
as
a simple arith-
metic variable used elsewhere
in
the
program. Each
is
recognized as being unique,
and no conflict
of
names
or
values results from this duplicate usage.
The maximum number
of
user-defined functions
in
a program
is
29, and
the
max-
imum number
of
nested function references varies according
to
the
complexity
of
the
referencing statement.
User-defined functions
that
are referred
to
during an
input
or
output
operation
cannot
themselves perform any input or
output.
65

Table of Contents

Other manuals for IBM 5100

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM 5100 and is the answer not in the manual?

IBM 5100 Specifications

General IconGeneral
Release Year1975
RAM16 KB - 64 KB
Storage204 KB tape drive
Display5-inch CRT
Operating SystemAPL/BASIC
ProcessorIBM PALM (1.9 MHz)

Related product manuals