You need to sign in to do that
Don't have an account?
GeorgeTrommelen
Bank account validation rule
Can anybody advise me how to make a validation rule for Dutch bank accounts?
Bank account validation rule
George
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
What about Dutch bank accounts are you trying to validate? The account number? Currency formatting? Etc.?
Hello Justin,
Thanks for the reply, it is about the ducht bank account numbers.
Regards,
George
What is the format of the account number? How many digits? Is it alphanumeric? Are there special characters such as hyphens (-) in it?
Do you have any examples of Dutch bank account numbers (please don't use real accounts, just make it up but keep it in the exact format)?
Message Edited by jpizzala on 06-02-2008 11:42 PM
var
sFiltered: String;
iCount: Integer;
iChar: Integer;
iValue: Integer;
begin
Result := False;
// Controleer minimum lengte
if Length(Banknummer) >= 9 then begin
// Filter alle niet-getallen
SetLength(sFiltered, Length(Banknummer));
iCount := 0;
for iChar := 1 to Length(Banknummer) do
if Banknummer[iChar] in ['0'..'9'] then begin
Inc(iCount);
sFiltered[iCount] := Banknummer[iChar];
end;
SetLength(sFiltered, iCount);
// Controleer nieuwe lengte
if Length(sFiltered) = 9 then begin
iCount := 0;
// Tel alle getallen op
//
// Elfproef theorie:
// Getal1 * 9 + Getal2 * 8 + Getal3 * 7, enz. moet deelbaar
// zijn door 11...
for iChar := 1 to Length(sFiltered) do begin
iValue := Ord(sFiltered[iChar]) - Ord('0');
iCount := iCount + (iValue * (10 - iChar));
end;
// Elfproef
if (iCount mod 11) = 0 then
Result := True;
end;
end;
end;
If the format is always 2 numbers + 1 space + 2 numbers + 1 space + 2 numbers + 1 space + 3 numbers, then you could use the following:
I'm sure there is a way to shorten the pattern - specifically the 2 numbers + 1 space pattern that occurs 3 times - but maybe someone more familiar with regular expressions will be able to help with that. :smileyhappy:
HTH
This can be the shotended form of the code