A
ll
and more about Sharp PC-1500
at
http://www.PC-1500.info
III.
THE MYSTERIOUS
(?)
ART
OF PROGRAMMING
The art
of
programming
has
heen needless
ly
shrouded in a veil of mystery
for
so long that most
people associate it with wizardry or mathematical genius.
The
fact is that
no
special talent for
pulling rabbits
out
of
hats is required. Nor is
it
necessary that
you
be
adept
at
solving partial
differential equations. Your greatest assets will
be
your patience, your logical rea1oning abilities,
your
atter>tion to detail, and your eagerness to learn. A willingness
to
accept challenges is also
useful (we won't
kid
you: at times programming
is
very challenging.
that's
the fun
of
itl.
Programming
is
an ar
t,
and
as
such requir
es
a Ii ttlc skill. a little
tr
ai
ning, a
nd
a
lot
of
practice.
It
is
no
t
our
intent in this manual to make a
seasoned
p
rog
ra
mm
er
out
of
you.
We
\-Viii
fa
miliarize
you with the basic operations
and
concepts
of
programming.
To
be a competent programmer
requires more, j
ust
as
good driving involves
mo
re
than k
no
wing
how
t<>
steer and
sh
~
ft
gear-s.
Many good books
on
programming
al
ready exist and we strongly urge you
to
patronize you
local computer
dealer and library, Several good books on programming in general
and
the BASIC
language
in
particular, a
re
listed in Appendix F.
A.
What Is A Program?
You may
br.
surprised to discover
that
a program is just a set
of
instru
ct
ions
that
the computer
follows one
at
a time. These instructio
ns
must
b~
given
to
the computer in a l
ang
uage it "under·
stands".
The SHARP PC-1500 "speaks" a dial
ect
of
BASIC, a widely used
and
very popular
programming language. Like other
la
nguages, BASIC has a special vocabulary and grammar
ru
le
s which are combined to form statements. It
you
speak to S
HA
HP
"ungrammatically",
or
in
unfamiliar vocabulary, the computer
will
al
ert
you
to
your err
or
. But it
i~
n
ot
diffic
ult
to
correctly instruct SHAR
P.
The
BASIC
language
wa
s originally developed to teach programming
principles
an
d
many
of its stateme
nts
contain
English
words
and other familiar sy1nbols.
B.
How
Do I Program?
As
you
use
SHARP
to
pro~Jram,
you
w
ill
foll
<>w
a certain r
out
i
ne.
T
he
in
str
uc
ti
ons
which make
up a program
are
e·ntered in
the
PROgram m
ode
.
The
se instructions are knovin
as
"st
atements"
in the BASIC
la
nguage.
To
begin execution ol th.ese statements, it is
r>ecessa
ry
to
switch to the
RUN
mode, and
then
to
ins
truct
SHARP
to
pro.:eed
by
typing the RUN command. For you
"experts",
who
already have the
two
programs
of
Chapter O under your belt. this will be familiar.
For
thos
e
who
are pecking ahead, let's try entering
.and
ru
nning a program:
Switch to the PROgram mode and issue the B
AS
IC
"com
mand" (more
on
commands
vs.
statements later I:
Th
is
will er•se any previous statements which may
be
left in memory. Type the following
lin
e:
Program Listing:
10
PR
I
NT
"GOOD
SHOW
!
..
Keystrokes:
rn
oo
mm
co
Ci.iJ
CD 1'""'1 c:::i m
CQJ CQJ CQJ
,
...
c•
l
rn
m
rn
oo
1'"'" 1
co
IT-
"n
c::::i
, •• ,
••
,
26
Do
not sale this PDF
!!!