![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#1
|
|||
|
|||
|
problema Función verificar imei (luhn)
buenas tardes tengo la siguiente consulta tengo esta función
Código:
function IMEIcheck(imei : string): string;
var
a : Integer;
sum : Integer;
i : Integer;
d : string;
ds : Integer;
begin
a := 0;
sum := 0;
for i := 0 to Length(imei)-1 do
begin
d := Copy(imei, Length(imei)-i, 1);
ds := StrToInt(d);
if a mod 2 = 0 then
ds := ds * 2;
if ds > 9 then
ds := ds - 9;
sum := sum + ds;
a := a + 1;
end;
sum := sum mod 10;
Result := IntToStr(10 - sum);
end;
Código:
var
s:string;
numero:integer;
begin
numero:= StrToInt(frm_principal.edit10.Text);
s:= IMEIcheck('numero');
edit11.Text:=s;
end;
|
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Problema con funcion Chr() en DXE5 | NPIdea | Varios | 1 | 09-01-2014 11:06:18 |
| Problema con funcion | giulichajari | C++ Builder | 9 | 18-08-2013 18:39:00 |
| problema con funcion!! | MOCOSO07 | HTML, Javascript y otros | 0 | 12-01-2009 16:39:40 |
| Problema con una funcion | Alliance | Varios | 5 | 09-10-2008 02:38:32 |
| Calcular último dígito del IMEI | Emilio | PHP | 4 | 14-04-2008 11:15:56 |
|