Ver Mensaje Individual
  #5 (permalink)  
Antiguo 09/05/2005, 14:30
Anerol
 
Fecha de Ingreso: octubre-2004
Ubicación: Santiago Chile
Mensajes: 119
Antigüedad: 19 años, 7 meses
Puntos: 0
Hola baby
mira este codigo valida el rut , esta en vb, ojala te sirva, no lo he probado asi que avisa como te fue

Public Function verifica(rut As String) As
String
Dim tur As String
Dim mult As Integer
Dim i As Integer
Dim suma As Integer
Dim valor As Integer

tur = StrReverse(rut)
mult = 2
For i = 1 To Len(tur)
If mult > 7 Then
mult = 2
End If
suma = mult * Mid(tur, i, 1) + suma
mult = mult + 1
Next

valor = 11 - (suma Mod 11)
If valor = 11 Then
verifica = "0"
ElseIf valor = 10 Then
verifica = "K"
Else
verifica = Str(valor)
End If
end Function


seee you