Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DLL Sintegra
Message
From
12/12/2003 12:32:12
Alexandre Sola
Witwise Adm de Bems S/C Ltda
São Paulo, Brazil
 
 
To
12/12/2003 11:39:14
Ricardo Artur Leite
Rc Systems Sol. Tec. Inf. Ltda.
São Paulo, Brazil
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00858519
Message ID:
00858656
Views:
14
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
Map
View

Click here to load this message in the networking platform