Sub Activity_Create(FirstTime As Boolean)
DoIt2
End Sub
Sub AddTwoTimes(time1 As String, time2 As String) As String
Dim m As Map
Dim hr1,mi1,se1,hr2,mi2,se2,thr,tmi,tse As String
m.Initialize
m = parse(time1)
hr1 = m.Get("Hours")
mi1 = m.Get("Minutes")
se1 = m.Get("Seconds")
m.Initialize
m = parse(time2)
hr2 = m.Get("Hours")
mi2 = m.Get("Minutes")
se2 = m.Get("Seconds")
thr = hr1+hr2
tmi = mi1+mi2
tse = se1+se2
If tse > 60 Then
tse = tse-60
tmi = tmi+1
End If
If tmi > 60 Then
tmi = tmi-60
thr = thr+1
End If
Return NumberFormat(thr,2,0) & ":" & NumberFormat(tmi,2,0) & ":" & NumberFormat(tse,2,0)
End Sub
Sub DoIt2
Dim t1,t2,t3 As String
t1 = AddTwoTimes("10:00:00","08:10:00")
t2 = AddTwoTimes(t1,"08:50:00")
t3 = AddTwoTimes(t2,"20:10:00")
Log(t1)
Log(t2)
Log(t3)
End Sub
Sub parse(timein As String) As Map
Dim h,mi,s As String
Dim m As Map
h = timein.SubString2(0,2)
mi = timein.SubString2(3,5)
s = timein.SubString(6)
m.Initialize
m.Put("Hours",h)
m.Put("Minutes",mi)
m.Put("Seconds",s)
Return m
End Sub