Hi,
I have functioning project which I'm trying to modify to display a list of times achieved, recorded with the relevant date, into date order.
The list already exists as a List of String, named 'times' currently with 28 items.
This is the method I thought I'd use:
I had to add the i.ToString in Line 9 to change the key names, after that all works up to line 12. Achieving 28 items in the 'order' list.
When I come to add lines 13 to 16, intellisense complains about the index in line 14:
Severity Code Description Project File Line Suppression State
Error BC30311 Value of type 'Integer' cannot be converted to 'Date'. SudokuRecord D:\Visual Studio Projects\Projects\SudokuRecord\Form1.vb 111 Active
So clearly I'm not using the correct code to read the list.
I've tried adding the index to the line in the list that I'm trying to read but can't find how to do that.
Poppa
I have functioning project which I'm trying to modify to display a list of times achieved, recorded with the relevant date, into date order.
The list already exists as a List of String, named 'times' currently with 28 items.
This is the method I thought I'd use:
Vb.net Code:
Private Sub SortDate() Dim txt As String Dim count As Integer = times.Count - 1 Dim order As New SortedList(Of Date, String) For i = 0 To count txt = Date.Parse(times(i).Substring(0, 12).Trim) txt = txt.Substring(0, 8) order.Add(txt & i.ToString, " " & times(i)) Next TextBox2.Clear() For i = 0 To count txt = order(i).Substring(10) TextBox2.AppendText(txt & NewLine) Next
When I come to add lines 13 to 16, intellisense complains about the index in line 14:
Quote:
Severity Code Description Project File Line Suppression State
Error BC30311 Value of type 'Integer' cannot be converted to 'Date'. SudokuRecord D:\Visual Studio Projects\Projects\SudokuRecord\Form1.vb 111 Active
I've tried adding the index to the line in the list that I'm trying to read but can't find how to do that.
Poppa