Solved

Checking a Belgian Bank account number

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 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