# "Elf proef" script

## Recommended Posts

In Dutch banking there is a test called the elf proef to test whether or not any bank number is valid or not. The calculation algorithm is quite simple but I couldn't find any online checks at the time so wrote one of my own. Now I have found this tool where you can do it online: http://cgi.dit.nl/bank.cgi

You can find more about the algorithm here: http://nl.wikipedia.org/wiki/Elfproef

This is the script that checks a dutch bank account number and tells you whether it is valid or not:

```\$bankNumber = InputBox("Elf proef", "Enter a dutch bank account number")
if @error Then Exit

\$l = StringLen(\$bankNumber)
if (\$l <> 9 And \$l <> 10) Then MsgBox(0, "Elf proef", "Every dutch bank account number has 9 or 10 digits. Your input is not valid because it has " & \$l & " digits.")

\$split = StringSplit(\$bankNumber, "")

\$output = "Bank account number to be checked: " & \$bankNumber & @CRLF

\$n = 1
\$total = 0
For \$i = \$split[0] To 1 Step -1
\$a = Number(\$split[\$i]) * \$n
\$output &= \$split[\$i] & " * " & \$n & " = " & \$a & @CRLF
\$n += 1
\$total += \$a
Next
\$output &= "____________ +" & @CRLF
\$output &= "        " & \$total & @CRLF & @CRLF

\$div = \$total / 11
\$output &= \$total & " / 11 = " & \$div & @CRLF

\$round = Round(\$div) == \$div

If \$round Then
\$output &= "This is a valid bank account number" & @CRLF
Else
\$output &= "This is NOT a valid bank account number" & @CRLF
EndIf

MsgBox(0, "Elf proef", \$output)```

##### Share on other sites

[dutch]

Kun je dit niet ook doen met een Persoonsnummer op je ID of paspoort?

[/dutch]

Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

##### Share on other sites

[dutch]

Kun je dit niet ook doen met een Persoonsnummer op je ID of paspoort?

[/dutch]

Klopt! Dat staat ook beschreven op de Wiki: http://nl.wikipedia.org/wiki/Elfproef

Het kan met acceptgiro's (daar kennen ze andere gewichten toe ipv 987654321) en met het nieuwe burgerservicenummer.

##### Share on other sites

burgerservicenummer.

Dat woord zocht ik! Ik dacht dit gehad te hebben tijdens het Wiskunde Examen 2009.

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

## Create an account

Register a new account