Sharp PC-1500 Instruction Manual page 82

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

Advertisement

All
and
more
about Sharp
PC-1500
at
http://www.PC-1500.info
120
IF T
> =
1
THE
N
140
130
T
=
T
+
12
140
IF
T
>
23. 5959
GOTO 20
150
CURSOR 18 :
PRINT
T
160 GOTO
110
C.13.
VAL
VAL
\:Ind
STAS arc
complernentary functions
which
convert
character
strings
to
and
frorn
a
numeric
variable.
The
function
VAL
converts a
s.tring containing
the
character
representation
of
a
number
into a
number,
\Vhich
is then stored
in a
variable
.
NOTE
:
When
anything
other than a d
igit
0
thru
9.
·
{d
ecimal
point}. +(posi
tive
sign),
-
(nega·
t
ivc
sign),
or
E (scientific notation)
is
used
in the
expression,
conversion
w
ill
end
w ;th
the
illegal
charac1er.
Example
1:
10
ZS
=
VAL
"-37"
Result
:
ZS
contai
ns
the number
-
37
Example 2
:
10
A
=
VAL .. 237.6"
Result:
A
contai ns
the
number 237
.6
0. PRINT USING
The
USING
statement allows a programmer
to
rigidly
control
the
format o
f
information
on
the
display.
This
allows
stand
a
rdi z~d
di
splays and prevents
loss
of information
.
When
the USING
c
lause appears.
a
lone
or
wi·
t
hin a
PR INT
o
r
PAUSE statement
,
it
defines
the
forma
t
for
all
subsequent
PR
INT
o
r
PAUSE
statements
until
the next
USING c lause is
encoun
tered
in
the pro9ra1n.
~ver
a
l
USING clauses
may appear
within a
single PRINT
o
r
PAUSE
sta tement. In this
case
each one defines the fo rmat
to
be
used
to print
the
listed variables until
the next
USING
clause
is encountered.
A
format is
specified
via
a
string
of
special characters
called
an "editing
string"
.
The
characters
,_..,ithin the editing string
define the
areas
of
the display available
for
information
and restrict
the
type of information
which
may
be
printed in
these
areas.
This
scheme is
the
same
general
scheme
employed
by
other
languages
such
as
COBOL
and
PL/I.
An
editing
string
may
be
stored
in
a
string
variable.
The
variable's
name
would then replace
the
editing
string
within th
e US
ING clause
.
This al lows
multiple fo rmats
wh ich
are selected
under
program control
.
The
characte rs
wh ich may
be
employed
within
editing
strings
are
summarized
below:
80
Do not
sale
this PDF
!!!

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents