4-315
Detailed Explanation of Functions
4MELFA-BASIC IV
Cvi
[Function]
Converts the character codes of the first two characters of a string into an integer.
[Format]
[Reference Program]
1 M1=Cvi("10ABC")
' &H3031 is assigned to M1.
[Explanation]
(1) Converts the character codes of the first two characters of a string into an integer.
(2) An error will be generated if the string consists of one character or less.
(3) Mki$ can be used to convert numerical values into a string.
(4) This can be used to reduce the amount of communication data when transmitting numerical data with
external devices.
[Reference]
,
Cvs
[Function]
Converts the character codes of the first four characters of a string into a single precision real number.
[Format]
[Reference Program]
1 M1=Cvs("FFFF")
' 12689.6 is assigned to M1.
[Explanation]
(1) Converts the character codes of the first four characters of a string into an single-precision real number.
(2) An error will be generated if the string consists of three character or less.
(3) Mks$ can be used to convert numerical values into a string.
[Reference]
,
,
,
,
,
<Numeric Variable>=Cvi(<Character String Expression>)
<Numeric Variable>=Cvs(<Character String Expression>)