EasyManua.ls Logo

Commodore PET - Page 178

Commodore PET
447 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Defines a function that calculates the
circumference of a circle. It takes a
single argument
R.
the radius of the
circle. and returns a single numeric
value. the circumference of the circle.
Prints 3.14159265 (the value of
?T).
Assigns to A the value calculated by
the user-defined function
FNC.
Uses the value calculated by the user-
defined function
FNC
as
a branch
condition.
?FNC(l)
A=FNC(14)
55
IF
FNC(X)
>60
GOTO
150
The
DEF
FN
definition statement
is
illegal in immediate mode. However. a
user-defined function that
has
been defined by a
DEF
FN
statement in the current
stored program can
be
referenced in
an
immediate mode statement.
Examples:
10
DEF
FNC(R)=
?T*Rf2
165

Table of Contents

Related product manuals