CV: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:_CV}} The _CV function is used to convert _MK$, ASCII, STRING values to numerical values. {{PageSyntax}} :{{Parameter|result}} = _CV({{Parameter|numericalType}}, {{Parameter|MKstringValue$}}) {{Parameters}} * {{Parameter|numericalType}} is any number type: INTEGER, LONG, SINGLE, DOUBLE, _INTEGER64, _FLOAT, _BYTE or _BIT. * Integer, Long, Byte and Bit values can be signed or _UNSIGNED. * The {{Para...")
 
m (Protected "CV" ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite)))
(No difference)

Revision as of 16:19, 4 May 2022

The _CV function is used to convert _MK$, ASCII, STRING values to numerical values.


Syntax

result = _CV(numericalType, MKstringValue$)


Template:Parameters


Description

  • The MKstringvalue$ value type must match the numerical type parameter used.
  • _MK$ string values consist of ASCII characters in the same byte length as the number value type.


Examples

Example: Using the _MK$ and _CV functions:

  
DIM i64 AS _INTEGER64
DIM i64str AS STRING

i64 = 2 ^ 61
i64str = _MK$(_INTEGER64, i64)

PRINT "I64:"; i64
PRINT "_MK$: "; i64str

i64 = _CV(_INTEGER64, i64str)
PRINT "_CV:"; i64  
I64: 2305843009213693952
_MK$:
_CV: 2305843009213693952
The _MK$ string result may not print anything to the screen, as in the example above, unless _CONTROLCHR is set to OFF.


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link