Difference between revisions of "CVSMBF"

From QB64.org wiki
Jump to: navigation, search
(Created page with 'CVSMBF converts a 4-byte string containing a Microsoft Binary format number to a single precision IEEE-format number. Explanation above taken directly from QuickBASIC help-syst…')
 
(style guidelines)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
CVSMBF converts a 4-byte string containing a Microsoft Binary format number to a single precision IEEE-format number.
+
The [[CVDMBF]] function decodes a 4-byte [[STRING]] generated by [[MKSMBF$]] (or read from a file) to [[SINGLE]] numeric values.
  
  
Explanation above taken directly from QuickBASIC help-system.
+
{{PageSyntax}}
 +
: {{Parameter|result!}} = [[CVSMBF]]({{Parameter|stringData$}})
  
  
CVSMBF helps you read old random-access files (if you ever find the need to) containing real numbers stored as strings in the Microsoft Binary format.
+
{{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$]] functions which can also deal with extended [[Data types|data types]].
 +
* [[SINGLE]] values can range up to 7 decimal point digits. Decimal point accuracy depends on whole value places taken.
  
  
 +
{{PageExamples}}
 +
''Example 1:'' Showcases the reduced space to store an encoded number.
 +
{{CodeStart}}
 +
a! = 700.2213
 +
{{Cl|PRINT}} "Value of a!:"; a!
 +
b$ = {{Cl|MKSMBF$}}(a!)
 +
{{Cl|PRINT}} "Value of a! encoded using MKSMBF$: "; b$
 +
{{Cl|PRINT}} "The string above, decoded using CVSMBF:"; {{Cl|CVDMBF}}(b$)
 +
{{CodeEnd}}
 +
{{OutputStart}}
 +
Value of a!: 700.2213
 +
Value of a# encoded using MKSMBF$: *♫/è
 +
The string above, decoded using CVSMBF: 700.2213
 +
{{OutputEnd}}
 +
: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:'' [[CVDMBF]], [[MKDMBF$]], [[MKSMBF$]]
 
  
 +
{{PageSeeAlso}}
 +
* [[MKD$]], [[MKI$]], [[MKS$]], [[MKL$]], [[MKDMBF$]], [[MKSMBF$]]
 +
* [[CVI]], [[CVS]], [[CVD]], [[CVL]], [[CVDMBF]]
 +
* [[_CV]], [[_MK$]]
  
==Navigation:==
 
  
[[Keyword_Reference_-_Alphabetical|Go to Keyword Reference - Alphabetical]]
+
{{PageNavigation}}
 
 
[[Keyword Reference - By usage|Go to Keyword Reference - By usage]]
 

Latest revision as of 14:28, 11 September 2017

The CVDMBF function decodes a 4-byte STRING generated by MKSMBF$ (or read from a file) to SINGLE numeric values.


Syntax

result! = CVSMBF(stringData$)


Description


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:"; CVDMBF(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



Navigation:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page