Commodore PET User Manual page 178

Table of Contents

Advertisement

Defines a function that calculates the
circu mference 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

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cbm

Table of Contents