Solved

Checking a Belgian Bank account number

Posted on 2004-04-30
4
380 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

734 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