A
ll
and more about Sharp PC-1500
at
http://www.PC-1500.info
120
IF T > = 1 THE N 1
40
130
T = T + 12
1
40
IF T >
23.
5959
GOTO
20
15
0 CURSOR
18
: PRINT T
160
GOTO 1
10
C.13.
VAL
VAL
\:In
d
STAS
arc complernentary functio
ns
which convert character strings
to
and frorn a
numeric
var
iable. The function
VAL
co
nver
ts
a
s.
tri
ng
containing the char
ac
ter representation
of
a number
into
a
numb
er, \Vhich is then sto
re
d in a variable.
NOTE: When
anyth
ing
other
than
a d
ig
it 0
th
ru 9. · {decimal point}.
+(po
si
tive sign), - (nega·
tivc s
ig
n),
or
E (scientific notation) is u
sed
in the
express
ion, conversion will end w;th the ille
ga
l
charac1e
r.
Ex
amp
le 1:
10 ZS = VAL
"-37"
Result :
ZS
con
tai
ns
the number - 37
Examp
le 2:
10
A = VAL ..
237.6"
Result:
A
co
ntains t
he
number
237
.6
0.
PRINT USING
T
he
US
I
NG
s
tatement
allows a programmer
to
rigidly
co
n
tro
l the
format
of i
nformation
on
t
he
displa
y.
This allows
stand
a
rdi
z~
d
di
splays
and
prevents loss of
informat
i
on
.
When t
he
US
ING
cl
au
se appears. al
one
or wi·t
hin
a PRINT or PAUSE
state
me
nt
,
it
def
ines
t
he
format for all s
ubsequent
PRINT or
PAUS
E
sta
t
eme
nts
unt
il
the
next
USING clause is
encountered
in
the
pro9ra1n.
~ve
r
a
l
USING clauses
may
appear
within
a single
PRINT
or PAUSE stat
ement.
In
this case
each
one
de
fines
the
for
mat
to
be us
ed
to
p
ri
nt
the
listed variables until
the
nex
t USING clause
is
encountered.
A format is specified via a string
of
special characte
rs
called an
"edit
i
ng
str
in
g"
. The characters
,_..,
ithin the editi
ng
string define the a
reas
of
the
di
sp
l
ay
ava
ilable for information and
res
tri
ct
the
type
of
information whi
ch
may be
pr
inted in these
areas
. This scheme is t
he
s
ame
ge
ne
ral
scheme
employe
d
by
othe
r languages
suc
h as COBOL
an
d
PL/I.
An editing stri
ng
may
be
stored in a string vari
ab
le. The variab
le
's name would then
re
place the
edit
ing
str
ing wit
hi
n the US ING clause . This al
lo
ws
mu
lt
i
ple
fo
rm
ats
whi
ch
are sel
ected
u
nde
r
pr
og
ram control.
T
he
charact
ers
wh
i
ch
may be em
ployed
with
in
edit
ing
str
ings
are
su
mm
arized
below:
80
Do
not sale this PDF
!!!