Sub lblPrev_Click
Log("Previous key clicked - Drawsubscript = " & DrawSubscript)
If DrawSubscript < 50 Then
'set the ticket colours back to blue
ResetTicketColours
'subtract 1 from the draw subscript to point to the previous draw
DrawSubscript = DrawSubscript + 1
'if we get to one end or the other of the 6 months of lotto draws then we need to make the text
'of the relevant button grey to indicate we can't go any further. Otherwise button text is white.
CheckButtonTextColour
If PrizeFor3(DrawSubscript) = 0 Then
lblPrev.Enabled = False
lblAddEdit.Enabled = False
lblNext.Enabled = False
pnlMenu.Enabled = False 'don't allow button clicking until the data's downloaded
'this gets reenabled in the Job3 code
ProgressDialogShow("Getting " & LastDrawDate(DrawSubscript))
DoEvents
Activity.Invalidate 'force the 'hourglass' to be displayed
DoEvents
HttpUtils.CallbackActivity = "Main" 'Current activity name.
DoEvents
HttpUtils.CallbackJobDoneSub = "JobDone"
DoEvents
'if the prize for 3 matching tickets hasn't been set for this draw then none of the prize values has been set
'so read the relevant web page and store the prizes in the array for this draw
LotteryPrizesURL = "http://www.lottery.co.uk/results/result.asp?LotteryID=2&ResultID=" & ResultID(DrawSubscript)
HttpUtils.Download("Job3", LotteryPrizesURL)
DoEvents
' ProgressDialogHide 'remove the 'hourglass'
Else
'the prize details have been read so display the winning numbers on the screen with the date including the day
'then check for matches
SetDrawDetails
CheckTickets
End If
Else
Msgbox("We can only go back 6 months","UK Lotto Checker")
End If
End Sub
There weren't any error messages. I edited hc_ResponseError & HandleError in HttpUtilsService to include a log message if either of them was entered as follows:
Sub hc_ResponseError (Response As HttpResponse, Reason As String, StatusCode As Int, TaskId As Int)
Log("hc_ResponseError Response = " & Response.GetString("UTF8") & _
", StatusCode = " & StatusCode & ", TaskId = " & TaskId)
countWorking = countWorking - 1
finishTasks = finishTasks + 1
HandleError(TaskId, Reason)
If Response <> Null Then
Log(Response.GetString("UTF8"))
Response.Release
End If
ProcessNextTask
End Sub
Sub HandleError(TaskId As Int, Reason As String)
Log("HandleError TaskId = " & TaskId & ", Reason = " & Reason)
Dim link As String
link = taskToRequest.Get(TaskId)
Log("Error. Url=" & link & " Message=" & Reason)
End Sub