Algorithm Math Delphi

Title: Bank account number validation
Question: How can I validate an bank account number ?
Answer:
In Europe, full bank account number has this format :
BBBBB-DDDDD-AAAAAAAAAAA-KK with :
BBBBB : Bank number ([0..9])
DDDDD : Deskptop number ([0..9])
AAAAAAAAAAA : Account number ([0..9][A..Z])
KK : Super key ([0..9])
To be sure that your end user will give you a right number for bank account, here is function to compute the super key (KK).
function GetSuperKey( sBankNo, sDeskNo, sAccountNo: String ): String;
const
// Some account number could have letter
// Equivalence table ( 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' );
// Letter to number ( '12345678912345678923456789' );
// we have only 26 alphabet letters ^
aLetter2Num: array[0..25] of Char = ( #49, #50, #51, #52, #53, #54, #55, #56, #57,
#49, #50, #51, #52, #53, #54, #55, #56, #57,
#50, #51, #52, #53, #54, #55, #56, #57 );
var
iBankNo, iDeskNo, iAccountNo, d, e, f, g, h, RIB: Int64;
I: Integer;
begin
iBankNo := StrToInt(sBankNo);
iDeskNo := StrToInt(sDeskNo);
sAccountNo := UpperCase(sAccountNo);
for I := 0 to Length(sAccountNo) do
if (sAccountNo[I] #64 and sAccountNo[I] sAccountNo[I] := aLetter2Num[Ord(sAccountNo[I]) - 65];
end;
iAccountNo := StrToInt64(sAccountNo);
d := iBankNo * 8;
iBankNo := Trunc(d / 97);
iBankNo := d - (iBankNo * 97);

e := iDeskNo * 15;
iDeskNo := Trunc(e / 97);
iDeskNo := 97 - (e - (iDeskNo * 97));
f := iAccountNo * 3;
iAccountNo := Trunc(f / 97);
iAccountNo := 97 - (f - (iAccountNo * 97));
g := iBankNo + iDeskNo + iAccountNo;
h := Trunc(g / 97);
RIB := g - (h * 97);
if RIB = 0 then RIB := 97;
Result := FormatFloat('00', RIB);
end;