Visual Basic 6 function "hexdec"

Go back

Below you'll find the source for the Visual Basic 6 function hexdec.

Attribute VB_Name = "modHexdec"
' This function is downloaded from:
' You may freely distribute this file but please leave all comments, including this one, in it.
' @Author Stefan Thoolen <>

Option Explicit

' Converts a heximal string to a decimal integer
' Same syntax as the PHP function 'hexdec'
' See also:
' @param    String  hex_string      The heximal string
' @return   Integer                 An integer value
' @author   Stefan Thoolen <>
Public Function hexdec(hex_string As String) As Integer
    hexdec = Val("&h" & hex_string)
End Function