Difference between revisions of "International Bank Account Number/fr"

From Lazarus wiki
Jump to navigationJump to search
m
m (Fixed syntax highlighting)
Line 11: Line 11:
 
Function StrMOD97 you find here [[ISO_7064#Function StrMOD97]]  
 
Function StrMOD97 you find here [[ISO_7064#Function StrMOD97]]  
  
<syntaxhighlight>
+
<syntaxhighlight lang=pascal>
  
 
function ReplaceLetterWithNumbers ( a_char:char):string;
 
function ReplaceLetterWithNumbers ( a_char:char):string;
Line 42: Line 42:
  
 
</syntaxhighlight>
 
</syntaxhighlight>
<br>
 

Revision as of 07:46, 18 February 2020

English (en) suomi (fi) français (fr)

Le numéro de compte bancaire international dit IBAN (International Bank Account Number) est une norme internationale pour numéroter les comptes bancaires. C'est la norme ISO 13616. L'IBAN consiste en 34 caractères alphanumériques, comprenant un code pays, deux chiffres de contrôle et un numéro de compte bancaire détaillé.

Le code pays suit la norme ISO 3166-1 alpha-2 Les chiffres de contrôle sont calculés selon la norme ISO 7064 (MOD97-10).

Fonction IsValidIban

Function IsValidIban checks is International Bank Account Number valid. Function StrMOD97 you find here ISO_7064#Function StrMOD97

function ReplaceLetterWithNumbers ( a_char:char):string;
var
  i: integer;
begin
  i := ord( upcase( a_char ) ) - ord( 'A' ) + 10;
  result := IntToStr( i );
end;   

function IsValidIban( s:string): boolean;
var
  a_char: char;
  s1: string;
  i : integer;
begin
  s := DelSpace( s );
  s1 := copy( s, 1, 4);
  delete(s, 1, 4);
  a_char :=  s1[1];
  delete(s1, 1, 1);
  s := s + ReplaceLetterWithNumbers ( a_char ) ;
  a_char :=  s1[1];
  delete(s1, 1, 1);
  s := s + ReplaceLetterWithNumbers ( a_char ) ;
  s := s + s1;
  i := StrMOD97( s );
  Result := i = 1;
end;