Hex Function

숫자의 16μ§„μˆ˜ 값을 λ‚˜νƒ€λ‚΄λŠ” λ¬Έμžμ—΄μ„ ν‘œμ‹œν•©λ‹ˆλ‹€.

ꡬ문:

Hex (Number)

λ°˜ν™˜ κ°’:

String

맀개 λ³€μˆ˜:

Number: 16μ§„μˆ˜λ‘œ λ³€ν™˜ν•  μž„μ˜μ˜ 숫자 μ‹μž…λ‹ˆλ‹€.

Error codes:

5 잘λͺ»λœ ν”„λ‘œμ‹œμ € ν˜ΈμΆœμž…λ‹ˆλ‹€.

예:

Sub ExampleHex

REM uses BasicFormulas in LibreOffice Calc

Dim a2, b2, c2 As String

    a2 = "&H3E8"

    b2 = Hex2Int(a2)

    MsgBox b2

    c2 = Int2Hex(b2)

    MsgBox c2

End Sub

 

Function Hex2Int( sHex As String ) As Long

REM Returns a Long-Integer from a hexadecimal value.

    Hex2Int = clng( sHex )

End Function

 

Function Int2Hex( iLong As Long) As String

REM Calculates a hexadecimal value in Integer.

    Int2Hex = "&H" & Hex( iLong )

End Function