Hier ein Link, wie man IBAN - International Bank Account Number - SWIFT berechnet.
mfg
Otto
http://www.xbaseforum.de/viewtopic.php?f=6&t=6863
IBAN - International Bank Account Number - SWIFT
IBAN - International Bank Account Number - SWIFT
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
-
- Posts: 824
- Joined: Thu Oct 13, 2005 7:39 am
- Location: Germany
Re: IBAN - International Bank Account Number - SWIFT
und eine Function, die IBAN zu überprüfen
Code: Select all
FUNCTION CheckIBAN (cIBAN)
LOCAL cCountryID := SubStr (cIBAN,1,2)
LOCAL cCheck := SubStr (cIban,5,Len(cIban)) +;
SubStr (CreateCountryID (cCountryID),1,4)+;
Substr (cIBAN,3,2)
LOCAL nCheck, nID
nID := ( _CalcModulo (cCheck))
nCheck := Int (nId % 97)
//? cCheck, nID, nCheck
RETURN (nCheck == 1)
//-------------------------------------------------------------//
STATIC FUNCTION CreateCountryID (cCountry)
LOCAL cLatin := "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
LOCAL nID := At (Substr(cCountry,1,1),cLatin)+9
LOCAL nID2 := At (Substr(cCountry,2,1),cLatin)+9
RETURN (Str (nID,2,0)+Str(nID2,2,0)+"00")
//---------------------------------------------------------------------//
STATIC FUNCTION _CalcModulo (cControlNr)
LOCAL nMod //:= Int (Val (cControlNr)) % 97
LOCAL nNr, cNr //:= 98 - nMod, nVal := Val (cControlNr)
LOCAL cMod := "", i, cID
FOR i := 1 TO Len (cControlNr) STEP 8
cNr := cMod+Substr (cControlNr,i,8)
nNr := Val (cNr) % 97
cMod := Str (nNr, Lennum (nNr),0)
NEXT
nMod := Int (Val (cMod))
RETURN (nMod)
kind regards
Stefan
Stefan