[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Stange things


Hi,


with this function :

Public Sub Base34Decoder(Value As String) As Long

  Dim lResult As Long
  Dim iDigitVal, i As Integer
  Dim aNum As Byte[] = Byte[].FromString(UCase(Value)).Reverse()

  For i = 0 To aNum.Max
    iDigitVal = IIf(aNum[i] >= Asc("2") And aNum[i] <= Asc("9"), aNum[i] -
50, aNum[i] - 57)
    lResult += iDigitVal * (34 ^ i)
  Next

  Return lResult

End

Public sub Main()
  Print Utils.Base34Decoder("3BG73G")
end

I get "Dépassement de Capacité" on the line <iDigitVal = IIf(aNum[i] >=
Asc("2") And aNum[i] <= Asc("9"), aNum[i] - 50, aNum[i] - 57)>


Why ???

Thank you for your help :-)



-- 
Fabien Bodard

Follow-Ups:
Re: Stange thingsGianluigi <gradobag@xxxxxxxxxxx>
Re: Stange thingsJussi Lahtinen <jussi.lahtinen@xxxxxxxxx>