Achei esta fun??o na internet…
8)
Veja no link http://www.set.rn.gov.br/sintegrarn/inscricao.htm
function TForm1.VerificarInscEstadual(IE:String):Boolean;
var nIE : String;
I: Integer;
soma,mult,resto : integer;
begin
result := false;
for I := 1 to Length(IE) – 1 do // Iterate
begin
if ((IE[I] ‘.’) and (IE[I] ‘-‘)) then
nIE := nIE + IE[I];
end; // for
soma := strtoint(nIE[1]) * 9;
soma := soma + strtoint(nIE[2]) * 8;
soma := soma + strtoint(nIE[3]) * 7;
soma := soma + strtoint(nIE[4]) * 6;
soma := soma + strtoint(nIE[5]) * 5;
soma := soma + strtoint(nIE[6]) * 4;
soma := soma + strtoint(nIE[7]) * 3;
soma := soma + strtoint(nIE[8]) * 2;
mult := soma * 10;
resto := mult mod 11;
Label2.Caption := inttostr(soma) + ‘ ‘ + inttostr(mult) + ‘ ‘ + inttostr(resto);
if resto = 1 then
result := True
else
result := false;
end;