General information
Category:
Coding, syntax & commands
Até aonde eu sei esta Dll só funciona para a Insc.Estadual mas eu você pode usar uma função para consistir os CPF e CNPJ
Ex de CPF
Function CPF && VERIFICA SE O DIGITO DO CPF ESTA CORRETO
*************
Parameters lcCPF
controle = ''
lcCPF1 = Left(lcCPF,9)
lcCPF2 = Right(lcCPF,2)
digito1 = ''
digito2 = ''
tot = 0
i = 0
For i = 1 To 9
a = ((11 - i) * Val(Substr(lcCPF,i,1)))
tot = tot + a
Endfor
digito1 = Str(11 - Mod(tot,11))
If Val(digito1) > 9
digito1 = '0'
Endif
digito1 = Alltrim(digito1)
tot = 0
For i = 1 To 9
a = ((12 - i) * Val(Substr(lcCPF,i,1)))
tot = tot + a
Endfor
tot = tot + (Val(digito1)*2)
digito2 = Str(11 - Mod(tot,11))
If Val(digito2) > 9
digito2 = '0'
Endif
digito2 = Alltrim(digito2)
controle = digito1 + digito2
If controle # lcCPF2
Return .F.
Else
Return .T.
Endif
Atenc.
Alexandre
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only