elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.
 
Inicio Ayuda Buscar Ingresar Registrarse
29 Mayo 2012, 09:00  


Tema destacado: Suscripción al boletín mensual de elhacker.net

+  Foro de elhacker.net
|-+  Programación
| |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo, raul338)
| | |-+  [Reto] IsHour
0 Usuarios y 2 Visitantes están viendo este tema.
Páginas: 1 [2] Ir Abajo Respuesta Imprimir
Autor Tema: [Reto] IsHour  (Leído 1,520 veces)
Elemental Code


Desconectado Desconectado

Mensajes: 499


Im beyond the system


Ver Perfil
Re: [Reto] IsHour
« Respuesta #15 en: 16 Septiembre 2011, 03:30 »

Rustic Mode ON!
[Rustic]

Código
Public Function eCode(ByRef Time As String) As Boolean
   On Error GoTo Fallo
   If Len(Time) <> 8 Then Exit Function
   Dim sTime() As String
   sTime = Split(Time, ":")
   If CLng(sTime(0)) >= 0 And CLng(sTime(0)) <= 23 And _
      CLng(sTime(1)) >= 0 And CLng(sTime(1)) <= 59 And _
      CLng(sTime(2)) >= 0 And CLng(sTime(2)) <= 59 Then eCode = True
Fallo:
End Function

[/Rustic]


En línea

Tenient101

Desconectado Desconectado

Mensajes: 127


Ver Perfil
Re: [Reto] IsHour
« Respuesta #16 en: 18 Septiembre 2011, 00:02 »

Bueno aqui el mio...  ;D

Código
Public Function IsHour(ByRef Expresion As String) As Boolean
Dim C()         As Byte
Dim L           As Integer
Dim P           As Integer
Dim F           As Boolean
 
L = Len(Expresion)
If (L And &H8) Then
   L = (L - &H8)
   If (L Or &H0) = &H0 Then
       C = StrConv(Expresion, vbFromUnicode)
       P = &H2
Sig0:
       L = C(P)
       If (L And &H20) Then
           L = (L - &H20)
           If (L And &H10) Then
               L = (L - &H10)
               If (L And &H8) Then
                   L = (L - &H8)
                   If (L And &H2) Then
                       L = (L - &H2)
                       If (L Or &H0) = &H0 Then
                           If (P And &H4) Then
                               GoTo Sig
                           Else
                               P = &H5
                               GoTo Sig0
                           End If
                       End If
                   End If
               End If
           End If
       End If
       Exit Function
Sig:
       L = C(0)
       L = (L - &H33)
       If (L And &H40) Then
           L = (C(0) - &H30)
           If (L And &H40) Then
               Exit Function
           Else
               If (L And &H2) Then F = True
               GoTo Sig2
           End If
       End If
       Exit Function
Sig2:
       L = C(1)
       L = (L - &H3A)
       If (L And &H40) Then
           L = (-&HB - L)
           If (L And &H10) Then
               L = ((Not L) - &H4)
               If (L And &H4) Then
                   GoTo Sig3
               Else
                   If Not F Then GoTo Sig3
               End If
           End If
       End If
       Exit Function
Sig3:
       P = &H3
Sig4:
       L = C(P)
       L = (L - &H36)
       If (L And &H40) Then
           L = (-L - &H7)
           If (L And &H8) Then
               P = (P + &H3)
               If (P And &H8) Then
                   P = &H4
                   GoTo Sig5
               Else
                   GoTo Sig4
               End If
           End If
       End If
       Exit Function
Sig5:
       L = C(P)
       L = (L - &H3A)
       If (L And &H40) Then
           L = (-L - &HB)
           If (L And &H10) Then
               P = (P + &H3)
               If (P And &H8) Then IsHour = True Else GoTo Sig5
           End If
       End If
   End If
End If
End Function
 

Alguien puede subir el proyecto completo del reto?, salu2 !


En línea
BlackZeroX (Astaroth)
Wiki

Desconectado Desconectado

Mensajes: 2.832


I'Love...!¡.


Ver Perfil WWW
Re: [Reto] IsHour
« Respuesta #17 en: 18 Septiembre 2011, 02:57 »

@BlackZero
Ahh, ok, te lo había copiado de un código tuyo de no sé donde... :silbar:

lo se pero yo lo hacia de la manera (Solo en/para numeros).

TipoNumerico1 = (TipoNumerico1.2 + TipoNumerico2)

Donde: TipoNumerico1.2 es del mismo tipo que TipoNumerico1 pero con valor 0... y el tipo resultante sera del tipo TipoNumerico1.2, mas no del TipoNumerico2...

ej.:

Código
 
dim lVal as long
dim bVal as byte
 
lval = (&H0 + bVal)
 
 

y tu lo haces de una manera un poco mas ofuscada... ya que como sabras si pones

Código
 
dim lVal as long
Const VAL as string = "10"
 
VAL
lval = (&H0 + VAL) ' // mas no (VAL + &H0)

 

Realizara su trabajo, pero le das mas trabajo independiente a el lenguaje y sabra solo el que resultados salgan... ya que como sabras "10" se deberia transformar a un valor de tipo numerico (Lo que yo hago en mi codigo y que seguro Raul338 me copio..  :xD :xD na no te creas es un gran programador  ;) :))
« Última modificación: 18 Septiembre 2011, 03:01 por BlackZeroX▓▓▒▒░░ » En línea

Web Principal-->[ Blog(VB6) | Host File (Public & Private) | Scan Port | (New)MyInfraPC (Descubre mi Contraseña venefi. $) ]



The Dark Shadow is my passion.
El infierno es mi Hogar, mi novia es Lilith y el metal mi
Páginas: 1 [2] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
reto en VB6
Ingeniería Inversa
ellolo 1 729 Último mensaje 15 Abril 2005, 10:03
por UnpaCker!
Reto
Bugs y Exploits
Blakord 9 1,223 Último mensaje 2 Julio 2005, 03:18
por BenRu
Reto CD Mac OS X
Mac OS X
@ZeRo~bLuE@ 0 1,378 Último mensaje 13 Febrero 2006, 01:53
por @ZeRo~bLuE@
Un reto !!! « 1 2 »
Programación Visual Basic
VirucKingX 24 2,752 Último mensaje 8 Mayo 2006, 23:36
por Kizar
Reto WPA
Hacking Wireless
tremola 6 821 Último mensaje 14 Junio 2006, 23:42
por o2T7f6j2
Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines