MrKim Well-Known Member Licensed User Longtime User May 14, 2018 #1 Correct: B4X: IME.SetCustomFilter(ValueTxt, ValueTxt.INPUT_TYPE_NUMBERS, "1234567890.") Not Correct (No quotes): B4X: IME.SetCustomFilter(ValueTxt, ValueTxt.INPUT_TYPE_NUMBERS, 1234567890.) Not Correct does not throw an error but it also doesn't work correctly. It KINDA works. Took me awhile to sort it out.
Correct: B4X: IME.SetCustomFilter(ValueTxt, ValueTxt.INPUT_TYPE_NUMBERS, "1234567890.") Not Correct (No quotes): B4X: IME.SetCustomFilter(ValueTxt, ValueTxt.INPUT_TYPE_NUMBERS, 1234567890.) Not Correct does not throw an error but it also doesn't work correctly. It KINDA works. Took me awhile to sort it out.
Erel B4X founder Staff member Licensed User Longtime User May 14, 2018 #2 SetCustomFilter expects a string. The compiler automatically converts numbers to strings: B4X: Label1.Text = 10 * 10 So it will happily convert the number you wrote to a string as well. Upvote 0
SetCustomFilter expects a string. The compiler automatically converts numbers to strings: B4X: Label1.Text = 10 * 10 So it will happily convert the number you wrote to a string as well.
MarkusR Well-Known Member Licensed User Longtime User May 14, 2018 #3 btw have b4a a compiler directive to disable automatically conversion? Upvote 0
MrKim Well-Known Member Licensed User Longtime User May 14, 2018 #4 Erel said: SetCustomFilter expects a string. The compiler automatically converts numbers to strings: B4X: Label1.Text = 10 * 10 So it will happily convert the number you wrote to a string as well. Click to expand... You know, as I recall the problem I had was the decimal didn't work-the decimal gets dropped in the conversion to a string - seems like a compiler error would be better here. Last edited: May 15, 2018 Upvote 0
Erel said: SetCustomFilter expects a string. The compiler automatically converts numbers to strings: B4X: Label1.Text = 10 * 10 So it will happily convert the number you wrote to a string as well. Click to expand... You know, as I recall the problem I had was the decimal didn't work-the decimal gets dropped in the conversion to a string - seems like a compiler error would be better here.
Erel B4X founder Staff member Licensed User Longtime User May 15, 2018 #5 MarkusR said: have b4a a compiler directive to disable automatically conversion? Click to expand... No. It is part of the B4X language. Upvote 0
MarkusR said: have b4a a compiler directive to disable automatically conversion? Click to expand... No. It is part of the B4X language.