elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Como proteger una cartera - billetera de Bitcoin


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  contro de errores
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: contro de errores  (Leído 1,237 veces)
andaluz


Desconectado Desconectado

Mensajes: 333



Ver Perfil
contro de errores
« en: 26 Octubre 2010, 20:49 pm »

me gustaria que me ayudarais a controlar el error.

Código
  1. On Error GoTo denei
  2.                                                'Código posible error
  3.                                                If Not lbl_d.Caption = lbl_dni1.Caption Then
  4.                                                    error = MsgBox("DNI no registrado", vbExclamation, "Error")
  5.                                                    Else
  6.                                                        If Not lbl_d.Caption = lbl_dni2.Caption Then
  7.                                                            error = MsgBox("DNI no registrado", vbExclamation, "Error")
  8.                                                        Else
  9.                                                            If Not lbl_d.Caption = lbl_dni3.Caption Then
  10.                                                                error = MsgBox("DNI no registrado", vbExclamation, "Error")
  11.                                                            Else
  12.                                                                If Not lbl_d.Caption = lbl_dni4.Caption Then
  13.                                                                    error = MsgBox("DNI no registrado", vbExclamation, "Error")
  14.                                                                    Else
  15.                                                                        If Not lbl_d.Caption = lbl_dni5.Caption Then
  16.                                                                            error = MsgBox("DNI no registrado", vbExclamation, "Error")
  17.                                                                        Else
  18.                                                                            If Not lbl_d.Caption = lbl_dni6.Caption Then
  19.                                                                                error = MsgBox("DNI no registrado", vbExclamation, "Error")
  20.                                                                            Else
  21.                                                                                If Not lbl_d.Caption = lbl_dni7.Caption Then
  22.                                                                                    error = MsgBox("DNI no registrado", vbExclamation, "Error")
  23.                                                                                Else
  24.                                                                                    If Not lbl_d.Caption = lbl_dni8.Caption Then
  25.                                                                                        error = MsgBox("DNI no registrado", vbExclamation, "Error")
  26.                                                                                    Else
  27.                                                                                        If Not lbl_d.Caption = lbl_dni9.Caption Then
  28.                                                                                            error = MsgBox("DNI no registrado", vbExclamation, "Error")
  29.                                                                                        Else
  30.                                                                                            If Not lbl_d.Caption = lbl_dni10.Caption Then
  31.                                                                                                error = MsgBox("DNI no registrado", vbExclamation, "Error")
  32.                                                                                        End If
  33.                                                                                    End If
  34.                                                                                End If
  35.                                                                            End If
  36.                                                                        End If
  37.                                                                    End If
  38.                                                            End If
  39.                                                        End If
  40.                                                End If
  41.  

el error creo que esta en la primera línea
Código
  1. On Error GoTo denei
pero nose como arreglar este error.

saludos


« Última modificación: 26 Octubre 2010, 21:15 pm por andaluz » En línea

ignorantev1.1


Desconectado Desconectado

Mensajes: 617


/\ Así acabo cuando quiero programar...


Ver Perfil WWW
Re: contro de errores
« Respuesta #1 en: 26 Octubre 2010, 21:26 pm »

Por que no crear un array de controles?
Código
  1.  dim i as integer
  2.  for i=1 to 10
  3.    if not lbl_d.caption=lbl_dni(i).caption then  goto denei
  4.  next
  5. denei:
  6.  MsgBox "DNI no registrado", vbExclamation, "Error"
  7.  


« Última modificación: 26 Octubre 2010, 21:28 pm por ignorantev1.1 » En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines