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.


  • 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 )

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
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));" ";
1) Avr-Controller standard formatting.