Sharp PC-1500A Instruction Manual page 32

Hide thumbs Also See for PC-1500A:
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
=
fiJ
30 PRINT "IN
CANADA, T
IS
THOUGHT'"
4fiJ PR
I
NT
ZZ
50
PRINTZ$
Keystrokes:
OJOO CD
I
•••Fri
C
$_J
I
=
)
1
..
,.,,
c:JCDCD
(SPA<:<)
00
ClD
0:0
Qi]
[jjJ
[.Ll
I"'•
r
I
CJ
l
<•1
u
l
moomrur=
1m
1 '".,...'
rn :71moornoorn1
......
,
CJ
rn
oo
,
..
..,.,
mm
mm
,
.....
,,OJ
(SPA«!
rn co
LD
1 ..
-
1
CIJ
oo w
OJJ
mm
CD
I
''"'"
I
c:J
l••rt•I
moo m
oo
rn
ao
CIJ
woo
,
.....
1
mrn
m
oornao
wm
~
(•HT••I
When
run,
this
program
should
produce
three
lines
of
o
utput as follows {press
l••,.•I
after
reading
c•ch
line):
OEG
AUN
I
t·4
CAMADA
,
TIS THOUGHT
[
•••
...
.
)
(1
(
•••
KUN
.
l
I
·=·
t·40UbHT
·-'
The first of
our
PR INT
statements
(line 301
dlsploys a character
string or
"literal".
Notice
that
the
double
quote marks
are
NOT
printed
as
part
of
the output.
They
are
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
lhe
second
and
third
PR
INT statements
{lines
40
and
50)
should
be
recognilable
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
they were specified
by
lines
10 and
20. Printing an
"empty"
variable
will result in
a lero
cir
a blanl<
depending
on
whether the
variable is
numeric
or
<:haracter.
Clever readers will
have observed
that character
strings and
the values
of
character variables
arc printed beginning
on
the left side
of the
display
.
This
is known as " left
justified".
By
contrast, numbers
and 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