EasyManua.ls Logo

Commodore VIC-20 - Page 129

Commodore VIC-20
404 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...
Chapter
3:
Programming the
VIC
20
Computer
115
report (or any other material)
ina
single day, you may wish to print the time
of day
at
the top of the report. That way you can tell the sequence in which
these reports were generated.
PEEK Fetches the contents of a memory byte.
TIS,
TI Fetches system time,
as
maintained by a program
clock.
FRE
Returns available free
space-the
number of unused
read/write memory bytes.
SYS
Transfers to subsystem.
USR Transfers to user assembly language program.
User-Defined
Functions
In addition to the many functions that are a standard part of VIC
BASIC, you can define your own arithmetic functions, providing they are
not very complicated. User-defined string functions are not allowed. Here
is
an example of a short program that uses a
DEF
FN (define function)
statement.
10
DEFNP(~)=100*X
20
INPUT
FI
30
PRINT
A/FNP(A)
40
OOTO
20
Following the
DEF
FN entry you can have any valid floating point
variable name. In this case P was entered, therefore the function name
becomes FNP.
If
the variable name were AB, the function name would be
FNAB.
In the
DEF
FN
statement, a single variable, enclosed in brackets, must
follow FN. This
is
the only variable name
that
can appear to the right of the
equal sign. This variable name
is
used within the
DEF
FN statement only;
you can use it in the body
of
the program without affecting the function.

Other manuals for Commodore VIC-20

Related product manuals