Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros temas > Trucos
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Los mejores trucos

 
 
Herramientas Buscar en Tema Desplegado
  #6  
Antiguo 25-07-2020
elmorsa elmorsa is offline
Registrado
 
Registrado: jul 2020
Posts: 5
Poder: 0
elmorsa Va por buen camino
He conseguido hacerlo en Delphi BASICO.



Como dije antes, no tengo ni idea, o sea que esto puede ser muy malo...


Funciones para transformar pais+CCC en IBAN:


Function Modulo97(const s: string): integer;
var
v, l : integer;
alpha : string;
number : longint;
begin
v := 1;
l := 9;
Result := 0;
alpha := '';

while (v <= Length(s)) do
begin
if (l > Length(s)) then
l := Length(s);
alpha := alpha + Copy(s, v, l);
number := StrToInt(alpha);
Result := number mod 97;
v := v + l;
alpha := IntToStr(Result);
l := 9 - Length(alpha);
end;
end;


Function ControlIBAN(const cuenta, Pais: string): string;
var
i, j: integer;
m: int64;
l: Integer;
t: string;
s: string;

function LetterToDigit(C: Char): string;
const
a: char = 'A';
var
d: byte;
begin
result := C;
if C in ['A'..'Z'] then
begin
d := (byte(C)-byte(a)) + 10;
result := IntToStr(d);
end;
end;

begin
try
t := Cuenta + Pais + '00';
s := '';
j := Length(t);
for i := 1 to j do
s := s + LetterToDigit(t[i]);
l:= Modulo97(s);
m:= int64(l);
i := 98 - m;
result := IntToStr(i);
if i < 10 then result := '0' + result;
except
result :='';
end;
end;


Function FormateaIBAN(const cuenta, Pais: string): string;
begin
result := Pais + ControlIBAN(Cuenta, Pais) + Cuenta;
end;
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 18:31:06.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi