Ver Mensaje Individual
  #5 (permalink)  
Antiguo 08/11/2007, 10:00
tammander
 
Fecha de Ingreso: enero-2006
Ubicación: Torroles (Costa der Só)
Mensajes: 1.017
Antigüedad: 19 años, 4 meses
Puntos: 7
Re: uBound y dimension de array vacio

Yo uso esta funcion, que sirva "pa tó"

Código:
' Chequea si la variable esta vacia (sea del tipo que sea)
Public Function IsBlank(byref TempVar)
    dim tmpType
    IsBlank = False
    select case VarType(TempVar)
        case 0, 1 '--- Empty & Null
            IsBlank = True
        case 8 '--- String
            if Len(TempVar) = 0 then
                IsBlank = True
            end if
        case 9 '--- Object
            tmpType = TypeName(TempVar)
            If (tmpType = "Nothing") Or (tmpType = "Empty") Then
                IsBlank = True
            End If
        case 8192, 8204, 8209 '--- Array
            if UBound(TempVar) = -1 then
                IsBlank = True
            end if
    end select
End Function


Un saludo
__________________
"Tus pecados son el estiércol sobre el que florecerán las flores de tus virtudes" - Gerald Messadié -