User manual

mikroBasic PRO for PIC32
MikroElektronika
589
ShortToHex
Prototype
sub procedure ShortToHex(dim input as short, dim byref output as
string[2])
Description Converts input number to a string containing the number’s hexadecimal representation. The output
string is right justied and remaining positions on the left (if any) are lled with zeros.
Parameters - input: short number to be converted
- output: destination string
Returns Nothing.
Requires Nothing.
Example
dim t as short
txt as string[2]
...
t = -100
ShortToHex(t, txt) ‘ txt is “9C”
Notes None.
WordToHex
Prototype
sub procedure WordToHex(dim input as word, dim byref output as string[4])
Description Converts input number to a string containing the number’s hexadecimal representation. The output
string is right justied and remaining positions on the left (if any) are lled with zeros.
Parameters - input: word to be converted
- output: destination string
Returns Nothing.
Requires Nothing.
Example
dim t as word
txt as string[4]
t = 1111
WordToHex(t, txt) ‘ txt is “0457”
Notes None.