CVSMBF: Difference between revisions
Jump to navigation
Jump to search
Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link
(Created page with "The CVDMBF function decodes a 4-byte STRING generated by MKSMBF$ (or read from a file) to SINGLE numeric values. {{PageSyntax}} : {{Parameter|result!}} = CVSMBF({{Parameter|stringData$}}) {{PageDescription}} * ''CV'' functions (CVD, CVS, CVI, CVL, CVDMBF, CVSMBF) are used to convert values encoded by ''MK$'' functions (MKD$, MKS$, MKI$, MKL$, MKDMBF$, MKSMBF$). * '''QB64''' has _CV and _MK$ f...") |
No edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
The [[ | The [[CVSMBF]] function decodes a 4-byte [[STRING]] generated by [[MKSMBF$]] (or read from a file) to [[SINGLE]] numeric values. | ||
Line 19: | Line 19: | ||
b$ = {{Cl|MKSMBF$}}(a!) | b$ = {{Cl|MKSMBF$}}(a!) | ||
{{Cl|PRINT}} "Value of a! encoded using MKSMBF$: "; b$ | {{Cl|PRINT}} "Value of a! encoded using MKSMBF$: "; b$ | ||
{{Cl|PRINT}} "The string above, decoded using CVSMBF:"; {{Cl| | {{Cl|PRINT}} "The string above, decoded using CVSMBF:"; {{Cl|CVSMBF}}(b$) | ||
{{CodeEnd}} | {{CodeEnd}} | ||
{{OutputStart}} | {{OutputStart}} | ||
Line 30: | Line 30: | ||
{{PageSeeAlso}} | {{PageSeeAlso}} | ||
* [https://qb64phoenix.com/forum/showthread.php?tid=1066 Featured in our "Keyword of the Day" series] | |||
* [[MKD$]], [[MKI$]], [[MKS$]], [[MKL$]], [[MKDMBF$]], [[MKSMBF$]] | * [[MKD$]], [[MKI$]], [[MKS$]], [[MKL$]], [[MKDMBF$]], [[MKSMBF$]] | ||
* [[CVI]], [[CVS]], [[CVD]], [[CVL]], [[CVDMBF]] | * [[CVI]], [[CVS]], [[CVD]], [[CVL]], [[CVDMBF]] |
Latest revision as of 19:29, 24 May 2024
The CVSMBF function decodes a 4-byte STRING generated by MKSMBF$ (or read from a file) to SINGLE numeric values.
Syntax
- result! = CVSMBF(stringData$)
Description
- CV functions (CVD, CVS, CVI, CVL, CVDMBF, CVSMBF) are used to convert values encoded by MK$ functions (MKD$, MKS$, MKI$, MKL$, MKDMBF$, MKSMBF$).
- QB64 has _CV and _MK$ functions which can also deal with extended data types.
- SINGLE values can range up to 7 decimal point digits. Decimal point accuracy depends on whole value places taken.
Examples
Example 1: Showcases the reduced space to store an encoded number.
a! = 700.2213 PRINT "Value of a!:"; a! b$ = MKSMBF$(a!) PRINT "Value of a! encoded using MKSMBF$: "; b$ PRINT "The string above, decoded using CVSMBF:"; CVSMBF(b$) |
Value of a!: 700.2213 Value of a# encoded using MKSMBF$: *♫/è The string above, decoded using CVSMBF: 700.2213 |
- Since the representation of a double-precision number can use up to 7 ASCII characters (seven bytes), writing to a file using MKSMBF$ conversion, and then reading back with the CVSMBF conversion can save up to 3 bytes of storage space.
See also
- Featured in our "Keyword of the Day" series
- MKD$, MKI$, MKS$, MKL$, MKDMBF$, MKSMBF$
- CVI, CVS, CVD, CVL, CVDMBF
- _CV, _MK$