Chr(), Mkb(), Mkw(), Mkt(), Mkl(), Mks()

The function create a numeric value in Little-endian-Format1) from a string with numeric content.

PreprocessorThe function is also available in the Praeprozessor, using constants only will not result in machine code.

Syntax

  • string = chr( value as byte )
  • string = mkb( value as byte )
  • string = mkw( value as word )
  • string = mkt( value as uint24 )
  • string = mkl( value as long )
  • string = mks( value as single )

Notice:
chr() und mkb() are the same function in different notation. mks() creates a string in the Standard IEEE, e.g. any value passed to the function will be converted to a Single and returned as a string.

[..]
dim a as word
dim b as long
dim s as string
a=1234
b=4567
s = mkw(a)  ' Word as a String
s = mkl(b)  ' Long as a String
s = mkb(65) ' Byte as a String, same as chr(65)
s = mks(a)  ' "a" ==> Single ==> String
' Dump of String content
print "s = ";
for i=1 to len(s)
  print "0x";hex(s.ByteValue(i));" ";
next
print
[..]
1) Avr-Controller standard formatting.