I store on MySQL / MariaDB database a duration of type Time.
I read it from Databaserow this way:
Self.duration = row.Column("duration").DateTimeValue
I show the value on my list control this way:
Var items() As Entities.TimesheetEntity = Entities.TimesheetEntity.Read
Var list As WebListBox = TimeSheetListBox
Var acc As ?? //pseudo code
list.RemoveAllRows
For each item As Entities.TimesheetEntity in items
list.AddRow (item.duration.ToString(DateTime.FormatStyles.None, DateTime.FormatStyles.Short)
acc = acc + duration //pseudo code
)
Next
mylabel.text = "total duration: " acc.toString //pseudo code
My problem is how can I make an accumulator and display the total duration after my loop?
10 posts - 5 participants