支持判斷返回任何數值型的類型數據:
Function GetNumType(sVal) Dim sType If Not IsNumeric(sVal) Then GetNumType="Unknow" Exit Function End If Execute "sType=TypeName("&sVal&")" GetNumType=sType End Function
測試: Response.Write GetNumType("9999") '返回:Integer Response.Write GetNumType("999999999") '返回:Long Response.Write GetNumType("99999999999999") '返回:Double Response.Write GetNumType("asdfasd") '返回:Unknow
|