select case probleme

Paladium

Member
Licensed User
Longtime User
I have following code being execute when an edit text ->textchange

B4X:
For i = 0 To New.Length - 1
         Select New.CharAt(i)
            Case "0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"
               aaa = Bit.ParseInt(ed3.Text, 16)
               ed4.Text = aaa
               aaa = 0
            Case Else
               ed3.Text = Old
               ed3.SelectionStart = ed3.Text.Length
               Return         
         End Select
      Next

it should prevent that characters like "s","t" or whatever is being parsed by bit.parseint() and runs into an error.

It does not work and I get a number format exception when I type in a "w" or so. With the select case it should not happen this way. Need urgently help, I'm doing something wrong here, aren't I?

Markus
 
Top