CV

From QB64 Wiki

Jump to: navigation, search

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


Syntax:

result = _CV(numericalType, stringValue$)


Description:

  • numericalType is any number type: INTEGER, LONG, SINGLE, DOUBLE, _INTEGER64, _BYTE or _BIT.
  • Integer, Long, Byte and Bit values can be Signed or _UNSIGNED.
  • The string number 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.


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 this example proved.


See also:

  • MKI$, CVI, INTEGER
  • MKL$, CVL, LONG
  • MKS$, CVS, SINGLE
  • MKD$, CVD, DOUBLE
  • MKSMBF$, CVSMBF (Microsoft Binary Format)
  • MKDMBF$, CVDMBF (Microsoft Binary Format)
  • CURRENCY



Navigation:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page
Views
  • Page
  • Discussion
  • View source
  • History
Personal tools
  • Log in
Toolbox
  • What links here
  • Related changes
  • Special pages
  • Printable version