public Sub ISO_6346_Ck(CtrNum As String) As Boolean
Dim acc, ax As Int
Dim lastnum, cnt, checkdigit As Int
Dim Indice As String = ("0123456789A?BCDEFGHIJK?LMNOPQRSTU?VWXYZ")
Dim Pow() As Int = Array As Int (1,2,4,8,16,32,64,128,256,512)
For cnt = 0 To 9
acc = acc + Indice.IndexOf(CtrNum.CharAt(cnt)) * Pow(cnt)
Next
lastnum = ((acc Mod 11) Mod 10)
checkdigit = Asc(CtrNum.CharAt(10))-48
If (CtrNum.Length = 11) And (lastnum = checkdigit) Then Return(True) Else Return (False)
End Sub