Question

I'm new to programing and to B4Android. I am trying to create an app that will let me insert the time into an EditText, display it on a Label and then start counting. How do I parse my result in EditText into Hours / Minutes using B4A? I would really appreciate any help!

Was it helpful?

Solution

If you just want to find the hours and minutes you can use code similar to:

Dim i As Int
i = EditText1.Text.IndexOf(":")
If i = -1 Then
    Msgbox("Invalid value.", "")
    Return
End If
Dim hours, minutes As Int
hours = EditText1.Text.SubString2(0, i)
minutes = EditText1.Text.SubString(i + 1)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top