欢迎光临:
非常感谢您光临枕善居。本站是一个免费的基于VB,VB.NET源代码交流的平台,为大家提供优质的专业的源代码,如果您有需要,本站可以帮助在业余时间里给您寻找代码。当然,如果您有好的代码也可以在本站发布,共享给大家。
专业VB和.NET源码、编程开发教程、图标资源、USB电脑遥控器、智能家电控制开关....更多东东请进入我的淘宝小店--->
VB及.NET新源码2011(3DVD,控件+资源)
智能多路控制(串口编程开关) 带源码!
06-05
31
判断数据类型函数
作者:枕善居主 / 查看次数: 8944 / 评论: 4
一个判断数据类型的函数,不同于VarType() 函数,VarType() 函数返回的是 integer型值,这个函数返回的是字符串。
Public Function getDataType(v As Variant) As String
Select Case VarType(v)
Case vbArray
getDataType = "vbArray"
Case vbBoolean
getDataType = "vbBoolean"
Case vbByte
getDataType = "vbByte"
Case vbCurrency
getDataType = "vbCurrency"
Case vbDataObject
getDataType = "vbDataObject"
Case vbDate
getDataType = "vbDate"
Case vbDecimal
getDataType = "vbDecimal"
Case vbDouble
getDataType = "vbDouble"
Case vbEmpty
getDataType = "vbEmpty"
Case vbError
getDataType = "vbError"
Case vbInteger
getDataType = "vbInteger"
Case vbLong
getDataType = "vbLong"
Case vbNull
getDataType = "vbNull"
Case vbObject
getDataType = "vbObject"
Case vbSingle
getDataType = "vbSingle"
Case vbString
getDataType = "vbString"
Case vbUserDefinedType
getDataType = "vbUserDefinedType"
Case vbVariant
getDataType = "vbVariant"
Case Else
getDataType = "Unknown Data Type"
End Select
End Function
Public Function getDataType(v As Variant) As String
Select Case VarType(v)
Case vbArray
getDataType = "vbArray"
Case vbBoolean
getDataType = "vbBoolean"
Case vbByte
getDataType = "vbByte"
Case vbCurrency
getDataType = "vbCurrency"
Case vbDataObject
getDataType = "vbDataObject"
Case vbDate
getDataType = "vbDate"
Case vbDecimal
getDataType = "vbDecimal"
Case vbDouble
getDataType = "vbDouble"
Case vbEmpty
getDataType = "vbEmpty"
Case vbError
getDataType = "vbError"
Case vbInteger
getDataType = "vbInteger"
Case vbLong
getDataType = "vbLong"
Case vbNull
getDataType = "vbNull"
Case vbObject
getDataType = "vbObject"
Case vbSingle
getDataType = "vbSingle"
Case vbString
getDataType = "vbString"
Case vbUserDefinedType
getDataType = "vbUserDefinedType"
Case vbVariant
getDataType = "vbVariant"
Case Else
getDataType = "Unknown Data Type"
End Select
End Function
发表评论
您没有权限发表评论!
上一篇
下一篇
相关日志:
文章来自:
Tags:
评论: 4 |
回复


该如何写啊??或者用那个控件来输入最好.
我想写个DLL,