public Sub ISO_6346_Ck(CtrNum As String) As Boolean
Dim acc, ax As Int
Dim s As String
Dim lastnum, cnt, checkdigit As Int
Dim Indice() As String= Array As String("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z")
Dim Value() As Int = Array As Int (0,1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,34,35,36,37,38)
Dim Pow() As Int = Array As Int (1,2,4,8,16,32,64,128,256,512)
Dim M As Map
M.Initialize
acc = 0
For cnt= 0 To Indice.Length - 1
M.Put(Indice(cnt),Value(cnt))
Next
For cnt = 0 To 9
s = CtrNum.CharAt(cnt)
ax = M.Get(s) * Pow(cnt)
acc = acc + ax
Next
lastnum = ((acc Mod 11) Mod 10)
checkdigit = Asc(CtrNum.CharAt(10))-48
If (CtrNum.Length = 11) And (lastnum = checkdigit) Then
Return(True)
End If
Return (False)
End Sub