1
« en: Miércoles 16 de Diciembre de 2009, 20:17 »
Function esHora(ByVal txt As String) As Boolean
Dim arr() As String = txt.Split(":")
If arr.GetLength(0) < 2 Then
Return False
ElseIf Not IsNumeric(arr(0)) Then
Return False
ElseIf Not IsNumeric(arr(1)) Then
Return False
ElseIf Not IsNumeric(arr(2)) Then
Return False
ElseIf arr(0) < 0 Or arr(0) > 23 Then
Return False
ElseIf arr(1) < 0 Or arr(0) > 59 Then
Return False
ElseIf arr(2) < 0 Or arr(0) > 59 Then
Return False
End If
Return True
End Function