Página Principal
 
Downloads
 
Nossa Loja Virtual
 
Contato
 
Cursos On Line
 
Lucre $$ com seu Site
 

Suporte OnLine

Menu principal
Loja Virtual
Login
Top Downloads
On Line
5 visitantes online (2 na seção: Scripts & Dicas)

Usuários: 0
Visitantes: 5

mais...



Testa CGC
  Enviado em Fri 03 Feb 2006 por admin (1980 leituras)
function TestaCgc(xCGC: String):Boolean;
{Testa se o CGC ? v?lido ou n?o}
Var
d1,d4,xx,nCount,fator,resto,digito1,digito2 : Integer;
Check : String;
begin
d1 := 0;
d4 := 0;
xx := 1;
for nCount := 1 to Length( xCGC )-2 do
begin
if Pos( Copy( xCGC, nCount, 1 ), '/-.' ) = 0 then
begin
if xx < 5 then
begin
fator := 6 - xx;
end
else
begin
fator := 14 - xx;
end;
d1 := d1 + StrToInt( Copy( xCGC, nCount, 1 ) ) * fator;
if xx < 6 then
begin
fator := 7 - xx;
end
else
begin
fator := 15 - xx;
end;
d4 := d4 + StrToInt( Copy( xCGC, nCount, 1 ) ) * fator;
xx := xx+1;
end;
end;
resto := (d1 mod 11);
if resto < 2 then
begin
digito1 := 0;
end
else
begin
digito1 := 11 - resto;
end;
d4 := d4 + 2 * digito1;
resto := (d4 mod 11);
if resto < 2 then
begin
digito2 := 0;
end
else
begin
digito2 := 11 - resto;
end;
Check := IntToStr(Digito1) + IntToStr(Digito2);
if Check <> copy(xCGC,succ(length(xCGC)-2),2) then
begin
Result := False;
end
else
begin
Result := True;
end;
end;
Índice :: Imprimir :: Enviar a um amigo




 
Language
Google
Web No Site
Novos Downloads
BrmSoft - ReAuto [Sistema de Controle de revenda de Veículos]
Versão: 1.3.1.1
Aplicativos
Tamanho: 5 MB
Data: 29/08/2009
Enviou: admin
BrmSoft - Imobiliária
Versão: 1.0
Aplicativos
Tamanho: 4 MB
Data: 09/02/2009
Enviou: admin
BrmSoft - SIADESC
Versão: 3.2
Aplicativos
Tamanho: 5 MB
Data: 26/01/2009
Enviou: admin
BrmSoft - Clínica
Versão: 1.8
Aplicativos
Tamanho: 4 MB
Data: 02/05/2008
Enviou: admin
DreaMule 3.0
Versão: 3.0
Compartilhadores de Arquivos
Tamanho: 6 MB
Data: 28/09/2007
Enviou: admin
Conteúdo