A
ll
and more about Sharp P
C-
1500 at http://www.PC-1500.info
C.6.5. LPRINT
The
LPRINT
command is
th
e main
co
mmand for displaying text information o:n the printer. It
is
similar in
nature
to
t
he
PRINT
command
of
the
PC· 1500, and they share several
of
the
sa
me
for
ms
. However,
be
cause
of
the
addit
i
ona
l
featu
r
es
available on the
printer.
the
actions
of
the
LPRI
NT
instruction arc more complex. We
v1ill
therefore concentrate on
the
subtleties involved
in us
in
g t
he
LPRINT s
tatement.
T
he
following discussion
of
the LPR INT
comrnand
assumes TEXT
mode
only.
Although
the given forms
may
work
in
GRAPH
mode, their <lPeration will be different.
The
pr
inti
ng
of
a
si
ngle
it
em
remai
ns
generally the same:
LPR
IN
T
item
where item
is
an
expressi
on.
character string,
number.
or
name of a variable
\•1hose
contents
will
be
printed. As usu
al,
characters
are
left justified and numbers are right justified.
Like the cursor
on
t
he
display, if the pen
is
not
positi
oned
at
the
l
eft
ol the
paper
,
pr
in
ting wi
ll
begin from the
pen's
position. T
he
position
of
the pen
may
be
changed
by
the LCURSOR
statement
or
by t
he
TAB
cl
ause (see
be
low).
A probl
em
occurs \
0
Jh
en
one tries to
pr
i
nt
an
item
v1hich
is
too
big
to f
it
on
one print li
ne
because
of
the
current
character size.
If
the
item
is
a
nu
mber an
ER
ROR
76
wi
ll
resul
t.
If
the
i
te
m is a
character
str
ing, the
string
wi
ll
l
>e
conti
nu
:
ed
on
t
he
next l
ine.
Concern for l
he
size
of
a p
ri
nted itern
is
also
impo
rtant for the
tw
o-item
LPRINT
statement. ·
whose form
is:
LP
RI
NT item 1. item 2
Usi
ng
CSIZE
1 guiirantees that two numeric items \viii be printed on the same line.
h'I
t
his
case,
the items w
ill
be justified in the
usua
l manner
v¥"ith
in the two halves
of
the printed line. For
LPRINTs involving strings
the
picture
is
n
ot
so
dear.
If the items
both
fit,
they
are justified
as
usual and printed
on
t
he
same line. If t
hey
do
no
·t
fit
, the results are usually split across
two
li
nes.
For
la
rg
er charact
er
sizes the
tw
o it
em
s
are
pr
inted
on tvJo successive
li
nes.
The
semicolon rnay also be used in the LPR
INT
statemen
t.
It serves
both
to
indicate
minimum
spaci
ng
of items
and
,
at
t
he
end
of
a
stateme
nt,
to
group
successively
pr
inted i
tems
on
the
same
line.
In
either
case, if the total length of the i
tems
exceeds the capaci
ty
of
the
pr
in
t
li
n
e,
the
it
ems
are p
ri
nted
on
succ
essive lines (as
many
as
necessary).
Th
e LPR INT with the semicolon
has
the
form:
LPR INT
it
em
1 ; ite
rn
2 · · · (etc)
or
the form:
L
PRINT
item
·list;
Several
of
t
he
\lforcmcntioncd forms
arc
used
in
the following demonstration p
ro
gram;
10
A$
=
..
ABCDEFG
..
20
B = 123456
30
FOR f = 1
TO
3
40
CSIZE I
50
LPRINT
AS
60
LPRINT AS, B
70
kPRINT
A$;
6
80
LF 5
90
NEXT
I
122
Do
not sale this PDF
!!!