Private Sub determine_max_len
Dim vers As List = Array(ver1, ver2, ver3, ver4, ver5, ver6, ver7, ver8, ver9, ver10, ver11, _
ver12, ver13, ver14, ver15, ver16, ver17, ver18, ver19, ver20, ver21, ver22, ver23, ver24, ver25, _
ver26, ver27, ver28, ver29, ver30, ver31, ver32, ver33, ver34, ver35, ver36, ver37, ver38, ver39, ver40)
Dim len As Int = dat.Length
Dim errorLevelAndIndex As Map = CreateMap("L": 64, "M": 65, "Q": 66, "H": 67)
If errorLevelAndIndex.ContainsKey(error_level) Then
Dim index As Int = errorLevelAndIndex.Get(error_level)
If len >= 0 Then version_no = 1
For i = 0 To vers.Size - 1
Dim v() As Int = vers.Get(i)
If len > v(index) Then version_no = i + 2
Next
End If