I have coded the following which works

Public Sub bBetStatus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bBetStatus.Click
GetBetStatus(104604222)         'Call getMUBets
End Sub
Public Sub GetBetStatus(ByVal YourMarket As Integer)
        Dim Req As New BFUK.GetMUBetsReq
        With Req
            .header = oHeaderUK()       'The standard header
            .marketId = 104604222        'The market of interest
            .betStatus = BFUK.BetStatusEnum.MU  'Return status of matched and unmatched bets
            .recordCount = 100    'Max 100 bets
        End With
        StateCount += 1
        BetFairUK.getMUBetsAsync(Req, StateCount)    'Send the request to the API
    End Sub
Public Sub BetFairUK_getMUBetsCompleted(ByVal sender As Object, ByVal e As BFUK.getMUBetsCompletedEventArgs) Handles BetFairUK.getMUBetsCompleted
            If Not e.Cancelled Then
                With e.Result
                    Print("ErrorCode = " & .errorCode.ToString)
                    If .errorCode = BFUK.GetMUBetsErrorEnum.OK Then
                        For i = 0 To .bets.Length - 1   'For all bets on the market
                            With .bets(i)
                                Print("BetId = " & .betId & " " & .betStatus.ToString & " Price = " & .price & " Size = " & .size)
                            End With
                    End If
                End With
            End If

        Catch ex As Exception
            Print(ex.Message)   'If problem
        End Try
    End Sub

which works

but when I try the following, the sub GetBetStatus is accessed but sub BetFairUK_getMUBetsCompleted is not accessed

Public Sub holdbetstatus(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub

The only difference I can see is the Handle statement, but I don't understand its significance.

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

5 Years
Discussion Span
Last Post by Reverend Jim

I'm not going to tell you what's wrong with the code just yet. What you need to do first is

  1. Tell us what the code is supposed to do. We shouldn't have to determine that by looking at the code
  2. Pretty it up to make it more readable. Add some white space. Youwouldn'tlikeitifIpostedasolutionlikethiswouldyou?
  3. Add some comments to document the code
  4. Put code tags around the code block to preserve the formatting

Once you do that and repost the code we will be more inclined to offer some help.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.