Commodore CBM Printer 4022 User Manual page 22

Hide thumbs Also See for CBM Printer 4022:
Table of Contents

Advertisement

PRINTING
UNDER PROGRAM CONTROL
As
we
have
seen,
you
can
control the
printer directly
from
the keyboard.
You
can
also control
the
printer
from
within a
BASIC
program.
In
the
example
below,
this
short
BASIC
program
is
placed
in
the
computer's
memory.
(It
could have been placed
there
from
the keyboard, a
cassette
tape,
or
a floppy
disk):
10
OPEN
3.4
20
CMD
3
30
PRINT'THIS
PROGRAM
ILLUSTRATES
PROGRAM
CONTROL"
40
LIST
REMEMBER
THIS:
The
LIST
command
within a
program
terminates
program
execution.
Then,
when
you
are finished
running
a
program,
you must
type the
PRINT#
command
to
close the channel.
Then
type the
CLOSE command
to
close the
file.
The
RUN
command
is
given
and
the
resulting printout
is
shown
here:
THIS PROGRAM
ILLUSTRfiTES
PROGRAM CONTROL
10
OPEN 3.4
28 CMD 3
30 PR
I
NT "THIS PROGRAM ILLUSTRATES PROGRAM CONTROL"
40 LIST
RE
ADV.
A
more
sophisticated
example shows
a
BASIC
program
that
takes
advantage
of
some
of
your
printer's
special features.
The
program
directs
the
printer to
generate the
following:
An
enhanced
heading.
You
will
find
more
about
this
feature
on page
32.
The
entire printer
character
set.
A
listing
of
the
program.
Two
special
character functions
are
used
in
the
program:
the
OFF/RVS
key
and
the
CRSR
Down
(Cursor
Down)
key.
You
may
find
out
more
about these
starting
on page
33.
17
-

Advertisement

Table of Contents
loading

Table of Contents