Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
Dim MyList As List = Array ("02:30", "05:30", "12:45", "03:25", "04:45")
Dim tempo As Long
DateTime.DateFormat = "HH:mm"
For Each tim As String In MyList
tempo = tempo + DateTime.DateParse(tim)
Next
Log("tempo=" & tempo)
Log(ConvertMillisecondsToString(tempo))
End Sub
Sub ConvertMillisecondsToString(t As Long)
Dim hours, minutes As Int
hours = t / DateTime.TicksPerHour
minutes = (t Mod DateTime.TicksPerHour) / DateTime.TicksPerMinute
CalcolaStipendio(hours, minutes, 5.00)
End Sub
Sub CalcolaStipendio(ore As Int, minuti As Int,costo_orario As Double) As Double
Dim total As Double = (ore * costo_orario) + (minuti * costo_orario / 60)
Log(total)
Return total
End Sub