PC SOFT
ONLINE REPOSITORY
FOR WINDEVWEBDEV AND WINDEV MOBILE

Home |  | Sign in | English US
WINDEV 29 - Check CPF
Published by amarildo
- Unclassified
New features



Description
WINDEV 29 - Check CPF
https://youtu.be/3j7oRZyTKhc
validar_cpf(pCpf is string)

_CPF is string
_Peso is 2-byte unsigned int
_Resto is 1-byte int
_Digito is 1-byte int

FOR i=1 _TO_ Length(pCpf)
IF 47 < Asc(pCpf[[i]]) < 58 THEN
_CPF+=pCpf[[i]]
END
END

IF Length(_CPF) <> 11 THEN RESULT False

FOR i=1 TO 10
_Peso = _Peso + (Asc(_CPF[[1 TO 10]][[i]]) -48)  * (10-i+2)
END

_Resto = modulo(_Peso,11)
IF _Resto < 2 THEN
_Digito = 0
ELSE
_Digito = 11 - _Resto
END

IF Val(_CPF[[11]]) <> _Digito THEN
RESULT False
ELSE
RESULT True
END
Illustrations, screen shots
none
none
User reviews
(To evaluate this resource, click 'Write a review')
No review or comment? Be the first one!
ABOUT
RATING:
00No rating
DOWNLOADS:
13
PUBLISHED:
March 27, 2024
VERSION:
1,0
CONCERNS:
WINDEV
Minimum version: windev 29
SIZE:
9.4 MB