Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private EditText1 As EditText
Dim sf As StringFunctions
End Sub
Public Sub Initialize
sf.Initialize
End Sub
Private Sub EditText1_FocusChanged (HasFocus As Boolean)
If HasFocus = False Then
If sf.Val(EditText1.Text) = 0 Then
xui.MsgboxAsync("Zero is not allowed!", "Error")
Return
End If
End If
End Sub
I wanted to get the INSIDE NUMERICAL value meaning EditText1.Text="0" will not match with EditText1.Text="00" ; ... but the inside NUMERICAL value of both is 0 .. End-user may input "0" or "00" or "0000" etc. and it is not possible to trap all such scenarios
But the inside NUMERIC value of such cases is always zero and we can trap that...
Another different scenario - Suppose EditText1.Text="ABC" (here inside NUMERIC value is again 0); So what is the eqvt. string function in B4X for getting the INSIDE NUMERIC VALUE of a string... ?
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private EditText1 As EditText
Dim sf As StringFunctions
End Sub
Public Sub Initialize
sf.Initialize
End Sub
Private Sub EditText1_FocusChanged (HasFocus As Boolean)
If HasFocus = False Then
If sf.Val(EditText1.Text) = 0 Then
xui.MsgboxAsync("Zero is not allowed!", "Error")
Return
End If
End If
End Sub