ByteToHex
str ByteToHex (int)
; ByteToHex

intByte = 221

;------------------------------------------------------------------------------------------------------------------------------------------
; Input Byte = 0..255
; Returns string of two uppercase HexChars = "0123456789ABCDEF"
;------------------------------------------------------------------------------------------------------------------------------------------
strByteToHexU = StrCat(Num2Char((intByte>>4)+48+7*((intByte>>4)>9)),Num2Char((intByte&15)+48+7*((intByte&15)>9)))
strByteToHexU = StrCat (Num2Char ((intByte >> 4) + 48 + 7 * ((intByte >> 4) > 9)), Num2Char ((intByte & 15) + 48 + 7 * ((intByte & 15) > 9)))

strByteToHexU = Num2Char((intByte>>4)+48+7*((intByte>>4)>9)):Num2Char((intByte&15)+48+7*((intByte&15)>9))
strByteToHexU = Num2Char ((intByte >> 4) + 48 + 7 * ((intByte >> 4) > 9)) : Num2Char ((intByte & 15) + 48 + 7 * ((intByte & 15) > 9))
;------------------------------------------------------------------------------------------------------------------------------------------

;------------------------------------------------------------------------------------------------------------------------------------------
; Input Byte = 0..255
; Returns string of two lowercase HexChars = "0123456789abcdef"
;------------------------------------------------------------------------------------------------------------------------------------------
strByteToHexL = StrCat(Num2Char((intByte>>4)+48+39*((intByte>>4)>9)),Num2Char((intByte&15)+48+39*((intByte&15)>9)))
strByteToHexL = StrCat (Num2Char ((intByte >> 4) + 48 + 39 * ((intByte >> 4) > 9)), Num2Char ((intByte & 15) + 48 + 39 * ((intByte & 15) > 9)))

strByteToHexL = Num2Char((intByte>>4)+48+39*((intByte>>4)>9)):Num2Char((intByte&15)+48+39*((intByte&15)>9))
strByteToHexL = Num2Char ((intByte >> 4) + 48 + 39 * ((intByte >> 4) > 9)) : Num2Char ((intByte & 15) + 48 + 39 * ((intByte & 15) > 9))
;------------------------------------------------------------------------------------------------------------------------------------------

Exit