hi guys
I just got a problem . I need to convert an edittext string into a number so as to use for a calculation .
I have tried the following :
Dim i AsInt
i = EditText.Text + 1
but unfortunately it doesn't work at all !
please someone tell me how to do that . in vb we do sth like this :
Val(sting)
but I don't know how it is done in B4A . by the way , I've searched allover the forum but nothing found !
Your code is correct. The compiler will convert the string automatically.
However you should use IsNumber to make sure that the text is actually a valid number:
B4X:
If IsNumber(EditText.Text) Then
Dim i As Int = EditText.Text + 1
End If