I was wondering if anyone can shed some light on what is going on here:-
what I am trying to do is create a view of all records of a specified date and criteria. once I have a record I then add it
to the tableview. ONE of the fields can contain a few visitors separated by a comma. The regex.spilt separates them into
an array. I skip the first occurrence as I want full detail in the line. If there is more than one then I want to blank out the
detail and only show the string from the split.
The Log(m) shows each split field lovely however when I add the row to the table it shows only the last occurrence a number
of times and blanks the detail section. It adds the correct number of entries but looks like the items.add seems to overwrite the
previous entry.
what it looks like without the regex.split... you will notice the second line shows detail and the visitor column with commas.
this is the output with the split. As you can see the second line detail has gone and the last occurrence of the split is shown
multiple times.
I have tried creating a subroutine that waits to complete but that just duplicates the entries and I get 6 entries on the table.
Any assistance would be appreciated
B4X:
Do While bookedCursor.NextRow
counter = 0
Dim xRow(6) As Object
xRow(0) = bookedCursor.GetString("InMate")
xRow(1) = bookedCursor.GetString("Cell")
xRow(2) = bookedCursor.GetString("TimeOfDay")
xRow(3) = bookedCursor.GetString("Visitor")
xRow(4) = bookedCursor.GetString("Occupation")
xRow(5) = bookedCursor.GetString("TypeOfBooking")
If DateTime.Date(bookedCursor.GetString("BookingsDate")) = DateTime.Date(ReportDate) Then
RegisterView.Items.Add(xRow)
Dim ar() As String = Regex.Split(",",xRow(3))
For Each m As String In ar
counter = counter +1
If counter > 1 Then
xRow(0) = " "
xRow(1) = " "
xRow(2) = " "
xRow(3) = m
Log(m)
xRow(4) = " "
xRow(5) = " "
RegisterView.Items.Add(xRow)
End If
Next
End If
counter = 0
Loop
what I am trying to do is create a view of all records of a specified date and criteria. once I have a record I then add it
to the tableview. ONE of the fields can contain a few visitors separated by a comma. The regex.spilt separates them into
an array. I skip the first occurrence as I want full detail in the line. If there is more than one then I want to blank out the
detail and only show the string from the split.
The Log(m) shows each split field lovely however when I add the row to the table it shows only the last occurrence a number
of times and blanks the detail section. It adds the correct number of entries but looks like the items.add seems to overwrite the
previous entry.
what it looks like without the regex.split... you will notice the second line shows detail and the visitor column with commas.
this is the output with the split. As you can see the second line detail has gone and the last occurrence of the split is shown
multiple times.
I have tried creating a subroutine that waits to complete but that just duplicates the entries and I get 6 entries on the table.
Any assistance would be appreciated