VAR2HEX var,string[,length]
Converts var (of any type) in hexadecimal and put result in string. Optional length parameter overrides the predefined length of the input variable.
String length should be twice the length of the variable to convert, to contain all the hexadecimal digits, otherwise output is truncated.