Solved

Checking a Belgian Bank account number

Posted on 2004-04-30
4
363 Views
Last Modified: 2011-04-14
Hi, I hope someone can give me a function to check wether a Belgian bank account number is right or not. I'm living in Belgium. An account number is like this: 111-1111111-11

I hope to get an answer very soon.

Thanks a lot
Marioway
0
Comment
Question by:marioway
  • 2
  • 2
4 Comments
 
LVL 7

Expert Comment

by:sftweng
ID: 10964256
What do you want to confirm, that it is syntactically corect, that it actually exists as confirmed by the bank or that a particular transaction will succeed?

We need more information.
0
 

Author Comment

by:marioway
ID: 10964899
I was not clearly enough. Sorry for that. I'm looking for a function that confirms the number actually exists. I found one in VB
but I don't know how to convert it into Delphi syntax.

Private Function ControleBankNummer(BankNummer As String) As Boolean

Dim Nummer As Double
Dim Rest As Integer
Nummer = Val(Left(BankNummer, 10))
Rest = CInt(Nummer - (97 * Fix(Nummer / 97)))
ControleBankNummer = IIf(Rest = Val(Right(BankNummer, 2)), True, False)

End Function

Thanks
marioway
0
 

Author Comment

by:marioway
ID: 10964977
It is 02.00 AM and Eureka, I found it . I was using Longint instead of Int64. My code now looks like this and it works:

procedure TAdministratie.MaskEdit2Exit(Sender: TObject);
var Nummer: Int64;
    Rest: Int64;
begin
 Nummer:= StrToInt64(Leftstr(MaskEdit2.Text, 10));
 Rest:= (Nummer)MOD 97;
 if Rest = StrToInt64(RightStr(MaskEdit2.Text, 2)) then
  begin
  end
 else
  ShowMessage('Verkeerd rekeningnummer. Corrigeer.');
end;

Thanks
marioway
0
 
LVL 7

Accepted Solution

by:
sftweng earned 500 total points
ID: 10965012
Good. Sometimes all that is needed is to talk with someone about it. ;-)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now