EasyManua.ls Logo

Casio FX-795P - VAL (Simple character variable); STR$ (Numeric expression)

Casio FX-795P
133 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...
CHAPTER7
Command
Reference
V
AL
(Simple
character
variable)
©
a
:
Function:
f
Converts
characters
in
a
simple
character
variable
into
a.numeric
value.
Parameter:
.
Simple
character
variable:
An
array
character
variable
cannot
be
used.
Explanation:
:
1)
Converts
characters
in
a
simple
character
variable
into
a
numeric
value.
2).When
the
content
of.
a
character
variable
includes
+,
-,
*,
E
or
E
,
it
is
converted
into
a
numeric
value
as
it
is.
When
A$
=
“-12.3”,
VAL(A$)
>
-12.3
3)
When
the
content
of
a
character
variable
starts
with
a
character
other
than
a
numeral,
+,
-,
or
*
,
an
error
occurs.
When
A$
=
“A45”,
VAL(AS)
>
error
(Error
2)
4)
When
a
character
other
than
a
numeral
is
inserted
in
the
middle,
only
the
part
before
this
character
is
converted
to
a
numeric
value.
When
A$
=
“78A9”,
VAL(AS)
>
78
Example:
10
Z$=*123"
2@
PRINT
VAL(Z$)+45
3@
END
*If
this
program
is
executed,
the
numeric
values
123
and
45
will
be
added
and
168
will
be
displayed.
176
7-3
Character
Functions
ST
R
$
(Numeric
expression)
®
Function:
Converts
the
value
of
a
numeric
expression
into
a
character
string.
Parameter:
Numeric
expression:
Numeric
value,
calculation
expression,
numeric
varia-
ble,
numeric
array
variable.
Explanation:
1)
Converts
the
value
of
a
numeric
expression
into
a
character
string.
2)
When
the
numeric
expression
is
a
calculation
expression,
the
calculation
:
result:is
converted
into
a
character
string.
3)
When
a
numeric
expression
is
positive,
the
sign
digit
is
deleted
and
only
the
numerals
are
converted.
Example:
18
A=123
2@
PRINT
STRS(A)+°45”
30
END
*If
this
program
is
executed,
character
strings
“123”
and
“45”
will
be.
con-
nected
and
“12345”
will
be
displayed.
(Same
as
“123”
+
“45”)
177

Related product manuals