Can anyone tell me how I can use this script sent to me (I'm assuming it's all there!) to verify an entry into an html form field? Thanks.
Code:
function Letra(Numero: Integer): string;
begin
Result:= copy('TRWAGMYFPDXBNJZSQVHLCKET',1 + numero mod 23,1);
end;
function EsNif(NIF: String): Boolean;
var
Numero: Integer;
begin
Result:= FALSE;
if TryStrToInt(Copy(NIF,1,Length(NIF)-1),Numero) then
Result:= Uppercase(Copy(NIF,Length(NIF),1)) = Letra(Numero);
end;
function EsNumero(Num: Char): Boolean;
begin
try
StrToInt(Num);
Result:=True;
Except
result:=False;
end;
end;
{Eliminamos espacios y separadores}
function CadLimpiaCar(NIF: String): String;
begin
Result:= NIF;
while (pos(' ',NIF)>0) do
delete(NIF,pos(' ',NIF),1);
while (pos('-',NIF)>0) do
delete(NIF,pos('-',NIF),1);
while (pos('/',NIF)>0) do
delete(NIF,pos('/',NIF),1);
Result:=NIF;
end;
Bookmarks