Hi, I am quite new to this android developing business (have worked with VB a fair bit) which is why I was drawn to b4a. At the minute, we're looking at converting one of our existing applications to mobile devices starting with android, thus considering purchasing the B4A software, I have been using the trial software to look into whether it will work for what it is we want to achieve ect.
/preamble.
The problem I am having is 2 fold.
Thanks in advance.
Q
/preamble.
The problem I am having is 2 fold.
- Integers are displaying as doubles
- Consquently I believe it is not reading the code correctly and causing my "if" statements to not be read i.e
B4X:
If dSecs.Text = 60 Then DMins.Text = + 1 End If
That is not updating the minutes counter, when the seconds timer display dSecs hits 60
I believe this is because 60 is being displayed as 60.0
B4X:
Sub Globals
Dim bStart As Button
Dim bStop As Button
Dim DISMins As Label
Dim DisSecs As Label
Dim DMins As Label
Dim dSecs As Label
Dim pbRest As ProgressBar
Dim tmrtimer As Timer
Dim a As Int
Dim b As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
a = "0"
Activity.LoadLayout("OSCEMain.bal")
tmrtimer.Initialize ("tmrtimer", 1000)
dSecs.Text = a
DMins.Text = a
End Sub
Sub tmrtimer_Tick
b = "1"
a = "0"
dSecs.Text = dSecs.Text + b
If dSecs.Text = 60 Then
DMins.Text = DMins.Text + 1
End If
If dSecs.Text = 60 Then
dSecs.Text = a
End If
End Sub
Sub bStart_Click
tmrtimer.enabled = True
End Sub
Sub bStop_Click
tmrtimer.enabled = False
dSecs.text = 0
End Sub
Thanks in advance.
Q
Last edited: