关于作者

Function之判断是否为空

上一篇 / 下一篇  2007-08-02 08:37:15 / 个人分类:asp源码

Function IsBlank(ByRef TempVar)
        IsBlank = False
        Select Case VarType(TempVar)
                'Empty & Null
                Case 0, 1
                        IsBlank = True

                        'String
                Case 8
                        If Len(TempVar) = 0 Then
                                IsBlank = True
                        End If

                        'Object
                Case 9
                        Dim tmpType
                        tmpType = TypeName(TempVar)
                        If (tmpType = "Nothing") or (tmpType = "Empty") Then
                                IsBlank = True
                        End If

                        'Array
                Case 8192, 8204, 8209
                        If UBound(TempVar) = -1 Then
                                IsBlank = True
                        End If
        End Select
End Function

TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)