EasyManua.ls Logo

Sharp PC-1500 - Page 47

Sharp PC-1500
169 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
A
ll
and more about Sharp
PC
-1
500
at
http://www.PC-1500.info
Program Listing:
10 PAUSE
"ARE
YOU
ASLEEP?"
20
INPUT "TYPE YES OR
NO
";
SX$
30
IF SXS =
"YES"
THEN
PR
ll
NT
"OH,
SORRY TO
DISTURB
YOU"
40
END
Keystrokes:
co
ClD
m
rn
o:o
m
m'
'"
"'
l C'.J
rn
mm
l
•••c
•t
rn
C<!J
[Ji]
ISP•ccl
rn
CD
co
ro
mm
I
SHOH
I
rn
I
SH1n
l
CJ
l
<•TE•
l
m
oo
co
oo
rn
OD
CD 1
"""'
1
c:i
co co
m
oo
1s
..
cc
1
CD
mm
!&>ACE!
[QJ
OD !SPACE]
OlJ
[Q]
!SPACE]
1
'""'
1
c::::i
1s""'
1omrn1
s"
"'
' m
tE•TE•
I
rnwcomm
rn
'
'""'
1rn 1 = ''
'""''
CJ
moom1
""
"'' c:::i
m 0:0
oo
mm
m CD oo m 1s""'1
CJ
OD
ao
(srnnl
ITI
!S>'ACtl m
[QJ
on m Q'.J I
SP•
«
ICD
CQJ
!SPACE]
00
CD([]
CD
I][)(]]
OD (
SP•C
EI CD
(QJ
OD
I
SH
I
FT
I
c::J
l
t:
N
T£11
)
IIl
(]]CD
CID
OD
I
E•n;
•I
This soporific program
wi
ll
on
ly
produce
ow
t
put
if you answer af'firmatively.
The
general form
of
the
IF
statement
, which line
30
ill
ustrates, is:
IF condition THEN
statement
During exceoJtion, the test embedded in
the
IF
clause
is
performed. Whether the
statement
is
performed,
or
not
,
dep
ends
on
the
res
ult
of
the
test. The
test
is
usually an i
neq
ua
li
ty
and
is
called
a
"c
ondition ." Reme
mb
er that inequaliti
es
are comparisons
\~Jh
i
ch
are
cithe·r
Tr
ue or Fa
ls
e.
If
the
inequality is True then the
statement
is
executed
.
If
the
inequality
is
False
the
n the
statement
is
skipped.
In
our
sample program
th
e test
is
whether
the
variable
SX$
is
equa
l
to
(contain1)
the
character
st
ri
ng
"YES''.
If
it does, and only if it does,
th
en t
he
PRINT instruction
is
fo
ll
owed.
If
SX$
is
not
eq
ual
to
"YES"'. then
the
PRINT instruction
is
ignored. In either case,
no
ma
ner
whether
the
PRINT
statement
is
ex
.ecuted
or
ignored, SHARP will
proceed,
as normal,
to
the
next
line. (In
our
sample
1irogr
am
th
e
next
line
is
line
40)
.
Notice
that
we
could have reversed
our
test
by
altering several lines in
the
following manner:
30
IF
SX$ =
"NO"
THEN
END
40
PRINT "
OH
, SORRY
TO
DISTURB
YOU"
This program, however,
is
not
quite
the
same as the original. It allows
our
apologetic
computer
to ta
lk
with
anyone
who mistypes
or
who
doesn't
answer with a
"NO".
In
add
it
i
on.
this program
really has
two
endpoints; the END
statement
in line
30
and
the
implied END beyond line
40.
Do
not sale this PDF
!!!

Table of Contents

Other manuals for Sharp PC-1500

Related product manuals