Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CLS
- DIM RUT AS STRING
- COLOR 0, 7
- LOCATE 1, 30: PRINT "Validar Rut Chileno."
- COLOR 7, 0
- INPUT "Ingrese su rut (sin puntos ni guion): ", RUT$
- Cant = LEN(RUT$)
- SELECT CASE Cant
- CASE 7: 'Rut con formado: 700.000-0
- Digitos$ = MID$(RUT$, 1, 6)
- Verificador$ = MID$(RUT$, 7, 1)
- FOR n = 1 TO 6
- Digitos(n) = VAL(MID$(Digitos$, n, 1))
- NEXT
- CASE 8: 'Rut con formato 1.000.000-0
- Digitos$ = MID$(RUT$, 1, 7)
- Verificador$ = MID$(RUT$, 8, 1)
- FOR n = 1 TO 7
- Digitos(n) = VAL(MID$(Digitos$, n, 1))
- NEXT
- CASE 9: 'Rut con formato 10.000.000-
- Digitos$ = MID$(RUT$, 1, 8)
- Verificador$ = MID$(RUT$, 9, 1)
- FOR n = 1 TO 8
- Digitos(n) = VAL(MID$(Digitos$, n, 1))
- NEXT
- END SELECT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement