You
could
also
include
one of the functions
in
a
program line,
as
the
following example shows;
10 FOB X= 1TOS
20 PRINT "THE SQUARE ROOT OF"; X;"IS"; SQR(X)
30 NEXT X
You'll
find a
complete listing of
the
numeric functions In the BASIC
Encyclopedia In
the back of
this manual.
NOTE:
Most commands have an
abbreviation
mat you can type
instead
o(
typing
out the
entire
BASIC name.
Your
Commodore 16
interprets the abbreviation exactly
as It
would read the full name.
An
example of an
abbreviation
is as follows
Lthen
O
prints
L
on your screen
Your
computer
reads this as It you'd typed out LOAD. Abbreviations
are useful
as a
tlmesaver. There
Is a
complete list of
the accepted
abbreviations m
the BASIC Encyclopedia
User
Defined Functions
An effective way lo use your computer's math capability Is to create
user
defined functions. User
defined
functions are extremely useful In
calculations,
and easy to
implement using your Commodore 16. User
defined functions allow you to program a
formula, ana then let your
computer plug
in vaiues
to be
calculated This can
be used
for many
different
purposes.
Here is a statement
utilizing
the user
defined function
for
calculating
Ihe
value of
a
secant
10DEFFNS(X)-1/COS(X)
This figures out the value of Ihe secant of
any
number entered lor X.
FNS
is
the name
of
the
function defined
by
this statement Appendix
C
contains a table of mathematical functions not included
in
your
computer's BASIC language
User defined
functions
save
memory
space when you would use a
function
more
than
once,
and
make
your programs easier
to
read
and
understand
62
!
I
I
i
I
CHAPTER
6
GRAPHICS
AND
COLOUR
•
Graphics characters
Character animation
Controlling
colours
High resolution graphics
Points, lines,
and labels
•
Squares, circles, polygons, and painting
!
[
I
[
Multi-colour graphics
63