
no comprendo por que cuando f = 10 me muestra el msgbox 10
Publicado por Ronnie (3 intervenciones) el 12/04/2018 00:22:32
Estimados tengo el siguiente codigo pero no comprendo por que cuando f = 10 me muestra el msgbox 10 siendo que cambio el balor de la variable a un string K
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Dim i As Integer, c As Integer, f As String, d As String, suma As Integer, a As String, h As Integer, j As Integer
Dim l As Integer, g As String, rut As String, calcula_digito As String
rut = InputBox("ingresa tu rut sin puntos ni guiones ")
a = 32765432
If Len(rut) = 7 Then
a = 2765432
End If
For i = Len(rut) To 1 Step -1
c = Mid(rut, i, 1)
d = Mid(a, i, 1)
h = CInt(d)
j = CInt(c)
l = h * j
suma = suma + l
Next
suma = suma Mod 11
f = 11 - suma
If f = 10 Then
f = "K"
If f >= 1 Or f <= 9 Then
calcula_digito = f
Else
calcula_digito = 0
End If
MsgBox f
End Sub
Valora esta pregunta


0