function TCKimlikGecerliMi( TCKimlikNo : string ) : Boolean ;
var
Tekler : Integer ;
Ciftler : Integer ;
Basamak10 : Integer ;
Basamak11 : Integer ;
Kontrol1 : Boolean ;
Kontrol2 : Boolean ;
begin
// tc kimlik no kontrol edilecek . . .
Tekler := StrToInt( TCKimlikNo[1] ) + StrToInt( TCKimlikNo[3] ) + StrToInt( TCKimlikNo[5] ) + StrToInt( TCKimlikNo[7] ) + StrToInt( TCKimlikNo[9] ) ;
Ciftler := StrToInt( TCKimlikNo[2] ) + StrToInt( TCKimlikNo[4] ) + StrToInt( TCKimlikNo[6] ) + StrToInt( TCKimlikNo[8] ) ;
Basamak10 := StrToInt( TCKimlikNo[10] ) ;
Basamak11 := StrToInt( TCKimlikNo[11] ) ;
Kontrol1 := ( Tekler * 7 - Ciftler ) mod 10 = Basamak10 ;
Kontrol2 := ( Tekler + Ciftler + Basamak10 ) mod 10 = Basamak11 ;
Result := ( Kontrol1 and Kontrol2 ) ;
end;
Hiç yorum yok:
Yorum Gönder