Sharp PC-1500 Instruction Manual page 32

Hide thumbs Also See for PC-1500:
Table of Contents

Advertisement

All
and
more about
Sharp PC -1500
at
http:/lwww.PC-1500.info
Enter
the following program
to
demonstrate
the
printing
of
single
items. (Remember
to
issue
the
NEW
command
before
you
begin.)
Program Listing:
10
ZS
=
"IS
NOUGHT
..
20
zz
=
0
30
PR INT
..
IN
CANADA, TIS THOUGHT"
40
PRIN
T ZZ
5.6
PRIN
T Z$
Keystrokes:
OJW
m
1
......
1
m
:
=
I
!Bi:il
....:.J
CD
CD
1
...
c•I
[][):OJ
[U
JI
G
I
uu
r 11
I
••orT
I
CJ
[•••<Al
w
r01
m
mc=
J 001 ...,,.1
CD
C!!Jmooco
'"""''CJf
•Jr
1
..
=
.
fSP•e<'
C:OlD._s:J
(• ..
c•I
T
J
(EJ
OL
lJ[)
[QJ
1
H
.LL..
{
~1n
j
C::J
IFHTEll
I
rn
oo
m ooco
When run,
this
pronrarn
should
pr'oduce three lines
of
output as follo\vs
(press
(
tN
f
L1t)
after
reading
each
line):
•••
••
IM
CAMAiiA,
TI::; THOUGHT
(
..
,
.
I
~~1
.
•••
..
,.
Tho first
of
our
PRINT
statements (line
30)
dis1
> lays a
character string or
"literal". Notice
that
the double
quote
marks
are
NOT
printed
as
part
of tho
output.
They arc necessary
to
" delimit",
or mark, the
beginning
or
end
of the sequence
of
characters which you wish to print.
This
sequence can
include any
character
except
the double quote
character
itself.
The
items
in the second
and third
PRINT
statements
(lines 40
and 501
should be
recognizable
to all readers as
variables.
When
a variable name is used within a print list,
the
value
of
the variable
is printed. In this case, we knew what the values of ZZ and ZS would be since lhey were specified
by lines 10 and 20. Printing
an
"empty" variable will result in a
zero
or
a
blank
depending
on
whether
the
variable is numeric
or
character.
Clever readers
will
have
observed that
character
strings
and
the
values
of character variables
are printed beginning
on the
left
side
of the d
isplay.
This
is
known
as
"left
justifie<I".
By
contrast,
numbers
.;ind the
values
of numeric
variables
are "right
justified"
.
30
Do not
sale
this PDF !!!

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents