Best wishes for 2009 to all users of this forum.
Sorting a table on a date column in the format dd/mm/yyyy
To sort this properly I add an invisible column with date parsed yyyymmdd:
Now on the device this is quite slow, some 8 secs for 400 rows.
One way to solve this would be to add the extra column in the desktop
application (a VB6 dll), but I wonder if there is any faster way to do this
on the device.
RBS
Sorting a table on a date column in the format dd/mm/yyyy
To sort this properly I add an invisible column with date parsed yyyymmdd:
B4X:
For i = 0 To Table1.RowCount -1
strDate = Table1.Cell(strDateColumn, i)
If StrLength(strDate) > 0 Then
'this is a bit faster than DateParse
'-----------------------------------
' Table1.Cell(strNewColumn, i) = SubString(strDate, 6, 4) * 10000 + _
' SubString(strDate, 3, 2) * 100 + _
' SubString(strDate, 0, 2)
Table1.Cell(strNewColumn, i) = SubString(strDate, 6, 4) & _
SubString(strDate, 3, 2) & _
SubString(strDate, 0, 2)
'Table1.Cell(strNewColumn, i) = DateParse(strDate)
Else
Table1.Cell(strNewColumn, i) = 0
End If
Next i
Now on the device this is quite slow, some 8 secs for 400 rows.
One way to solve this would be to add the extra column in the desktop
application (a VB6 dll), but I wonder if there is any faster way to do this
on the device.
RBS