Hex Function

Returns a string that represents the hexadecimal value of a number.

แƒกแƒ˜แƒœแƒขแƒแƒฅแƒกแƒ˜


Hex (Number)

แƒ“แƒแƒ‘แƒ แƒฃแƒœแƒ”แƒ‘แƒฃแƒšแƒ˜ แƒ›แƒœแƒ˜แƒจแƒ•แƒœแƒ”แƒšแƒแƒ‘แƒ:

แƒกแƒขแƒ แƒ˜แƒฅแƒแƒœแƒ”แƒ‘แƒ˜

Parameters:

แƒขแƒ”แƒฅแƒกแƒขแƒ˜: แƒ—แƒฅแƒ•แƒ”แƒœแƒ—แƒ•แƒ˜แƒก แƒ แƒ”แƒ“แƒแƒฅแƒขแƒ˜แƒ แƒ”แƒ‘แƒ˜แƒกแƒ—แƒ•แƒ˜แƒก แƒกแƒแƒกแƒฃแƒ แƒ•แƒ”แƒšแƒ˜ แƒœแƒ”แƒ‘แƒ˜แƒกแƒ›แƒ˜แƒ”แƒ แƒ˜ แƒขแƒ”แƒฅแƒกแƒขแƒฃแƒ แƒ˜ แƒ’แƒแƒ›แƒแƒกแƒแƒฎแƒฃแƒšแƒ”แƒ‘แƒ.

Error codes:

D'oh! You found a bug (text/sbasic/shared/00000003.xhp#err5 not found).

แƒ›แƒแƒ’แƒแƒšแƒ˜แƒ—แƒ˜:


Sub ExampleHex
' uses BasicFormulas in LibreOffice Calc
Dim a2, b2, c2 As String
    a2 = "&H3E8"
    b2 = Hex2Lng(a2)
    MsgBox b2
    c2 = Lng2Hex(b2)
    MsgBox c2
End Sub
 
Function Hex2Lng(sHex As String) As Long
' Returns a 32-bit signed integer number from an 8-digit hexadecimal value.
    Hex2Lng = clng( sHex )
End Function
 
Function Lng2Hex(iLong As Long) As String
' Calculates the 8-digit hexadecimal value out of a 32-bit signed integer number.
    Lng2Hex = "&H" & Hex( iLong )
End Function

Please support us!