Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DLL Sintegra
Message
De
12/12/2003 12:32:12
Alexandre Sola
Witwise Adm de Bems S/C Ltda
São Paulo, Brésil
 
 
À
12/12/2003 11:39:14
Ricardo Artur Leite
Rc Systems Sol. Tec. Inf. Ltda.
São Paulo, Brésil
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00858519
Message ID:
00858656
Vues:
15
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform