Difference between revisions of "MKL$"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
(Created page with 'The '''MKL$''' function converts a numerical value to a LONG value represented as a 4 byte string. ''Syntax:'' 4byt_string$ = MKL$(long_value&) * The numerical data usu…')
 
imported>SMcNeill
m (-)
 
(20 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The '''MKL$''' function converts a numerical value to a [[LONG]] value represented as a 4 byte string.
+
The [[MKL$]] function encodes a [[LONG]] numerical value into a 4-byte [[ASCII]] [[STRING]] value.
  
  
 +
{{PageSyntax}}
 +
: {{Parameter|result$}} = [[MKL$]]({{Parameter|longVariableOrLiteral&}})
  
''Syntax:'' 4byt_string$ = MKL$(long_value&)
 
  
 +
{{PageDescription}}
 +
* {{Parameter|longVariableOrLiteral&}} is converted to four ASCII characters. To see this in action, try {{InlineCode}}PRINT MKL$(12345678){{InlineCodeEnd}}.
 +
* The numerical data usually takes up less bytes than printing the [[LONG]] number to a file.
 +
* [[LONG]] integer values can range from -2147483648 to 2147483647.
 +
* Since the representation of a long number can use up to 10 ASCII characters (ten bytes), writing to a file using [[MKL$]] conversion, and then reading back with the [[CVL]] conversion can save up to 6 bytes of storage space.
 +
* [[CVL]] can convert the value back to a [[LONG]] numerical value.
 +
* [[LONG]] numerical variable values [[PUT]] into a [[BINARY]] file are automatically placed as an MKL$ [[ASCII]] string value.
  
  
* The numerical data usually uses less bytes than printing the LONG number to a file.
+
{{PageExamples}}
 +
See examples in:
 +
* [[SAVEIMAGE]]
 +
* [[SaveIcon32]]
  
  
 +
{{PageSeeAlso}}
 +
* [[MKI$]], [[MKS$]], [[MKD$]]
 +
* [[CVD]], [[CVI]], [[CVS]], [[CVL]]
 +
* [[_MK$]], [[_CV]]
  
  
 
+
{{PageNavigation}}
==Navigation:==
 
 
 
[[Keyword_Reference_-_Alphabetical|Go to Keyword Reference - Alphabetical]]
 
 
 
[[Keyword Reference - By usage|Go to Keyword Reference - By usage]]
 

Latest revision as of 13:07, 12 October 2017

The MKL$ function encodes a LONG numerical value into a 4-byte ASCII STRING value.


Syntax

result$ = MKL$(longVariableOrLiteral&)


Description

  • longVariableOrLiteral& is converted to four ASCII characters. To see this in action, try PRINT MKL$(12345678).
  • The numerical data usually takes up less bytes than printing the LONG number to a file.
  • LONG integer values can range from -2147483648 to 2147483647.
  • Since the representation of a long number can use up to 10 ASCII characters (ten bytes), writing to a file using MKL$ conversion, and then reading back with the CVL conversion can save up to 6 bytes of storage space.
  • CVL can convert the value back to a LONG numerical value.
  • LONG numerical variable values PUT into a BINARY file are automatically placed as an MKL$ ASCII string value.


Examples

See examples in:


See also



Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page