Solved

Checking a Belgian Bank account number

Posted on 2004-04-30
4
364 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 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

26 Experts available now in Live!

Get 1:1 Help Now