Sub dec2hex (inp As Int) As String
Dim hex As List
hex.Initialize
hex.AddAll(Array As String("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"))
If inp>255 Then
inp=255
End If
Dim l As Int=inp/16
Dim r As Int=inp Mod 16
Return hex.Get(l)&hex.Get(r)
End Sub