In Keys - Sharp PC-1500A Instruction Manual

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

Advertisement

All
and
more
about Sharp PC-1500
at
http://www.PC-1500.info
Example 2:
10
z
=
65
20
PRINT CHRS
Z
Output:
nuN
A
The
first
example shows the use of an ASCII
decimal
code as an
argument.
The result is con·
catcnatcd
t
o the strring .. OP" producing
"COP"
.
The
second example assigns
a
numeric value
to the
variable
Z.
The variable name
is then
used
as
the
argument.
(esulting in the cha racter
"A".
Our
next
sample
program converts
the
upper
case characters in a text string to lower-case using
both
ihe
ASC and
the
STR$ functions
:
Example
3:
5
WA IT 0
10
INPUT
"
ENTER MESSAGE"
',
M$
20 FOR
I
=
1
TO
LEN {MS)
30 T$
=
MIDS
(MS.
1
.
1)
40 L
=
ASC (TS)
45
I
F
(L
<
651 OR
(L
>90) THEN 60
50
TS
=
CH
RS
(L
+
32)
60 PRI
NT
TS;
70 NEXT I
80
WAIT:
PR INT
C.3.
I
N KEYS
This h.JnCtion
takes in any
character
from the keyboard
and stores
it
in
the specif ied variable
.
There is no need to
press
!ENTER! because the
character
VJill
be automaticalfy accepted
.
variable
=
INKEYS
During executio
n
of this
statement
a prompt
character is
not displayed unless
a previous
PR INT
statement is
used. The
input
character
is
not echoed
back to the
dis11lay
~nd
the
displ~y
remains
unaffected
.
Example:
HJ WA
IT
Ir
20' A$= INKEY$
30' I
F
A$
=
··
.. THEN PR INT
"NO
KEY": GOTO 20'
40'
PRINT
A$
50'
GOTO 20
This
function
will
only
accept
one
character.
If
more
than
one
is
keyed,
only
the
fi
rst
character
w
ill be
read
in; all
others
will be ignored
.
74
Do not sale this PDF
!!!

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents