"," and "."
Thank you, indeed the whole problem of uses ",".
Thank you, indeed the whole problem of uses ",".

Dim zReq As New BFUK.GetMarketProfitAndLossReq
Dim zResp As New Object '<<< This is different
With zReq
.header = oHeaderUK
.marketID = [i]Your marketId of interest[/i]
End With
zResp = BetfairUK.getMarketProfitAndLoss(zReq) 'Call the API
With zResp
CheckHeader(.header)
Print(.errorCode.ToString)
If .errorCode = BFUK.GetMarketProfitAndLossErrorEnum.OK Then
For i = 0 To UBound(.annotations)
With .annotations(i)
zPrice1(i).Value = .selectionName
zPrice2(i).Value = .ifWin
zPrice3(i).Value = .ifLoss
End With
Next
End If
End With

.fromDate = "2009-03-13T14:20:00.729Z" .toDate = "2009-03-14T14:20:00.729Z"
Dim Req As New betfair.UK.exchange.GetAccountFundsReq()
Dim Resp As New betfair.UK.exchange.GetAccountFundsResp()
With Req
.header = oHeaderUK()
End With
'-------------------------------------------------------------
'Resp = betfair.UK.exchange.GetAccountFunds(Req) << Incorrect!
'GetAccountFunds is not avaiable
Resp = BetFairUK.getAccountFunds(Req) '<<< Should be this
'-----------------------------------------------------------
With Resp
CheckHeader(.header)
If .errorCode = betfair.UK.exchange.GetAccountFundsErrorEnum.OK Then
lbl.Text = .availBalance
End If
End With
Class UnpackMarketPricesCompressed
Inherits BFUK.MarketPrices
Private Const ColonCode = "&%^@" 'The substitute code for "\:"
Sub New(ByVal MarketPrices As String) 'Unpack the string
Dim Mprices, Part, Field As String(), n As Integer
Mprices = MarketPrices.Replace("\:", ColonCode).Split(":") 'Split header and runner data
Field = Mprices(0).Replace("\~", "-").Split("~") 'Split market data fields
marketId = Field(0) 'Assign the market data
currencyCode = Field(1)
marketStatus = [Enum].Parse(GetType(BFUK.MarketStatusEnum), Field(2), True)
delay = Field(3)
numberOfWinners = Field(4)
marketInfo = Field(5).Replace(ColonCode, ":")
discountAllowed = (Field(6).ToLower = "true")
marketBaseRate = Val(Field(7))
lastRefresh = Field(8)
removedRunners = Field(9).Replace(ColonCode, ":")
bspMarket = (Field(10) = "Y")
n = UBound(Mprices) - 1
ReDim runnerPrices(n)
For i = 0 To n 'For each runner
Part = Mprices(i + 1).Split("|") 'Split runner string into 3 parts
Field = Part(0).Split("~") 'Split runner data fields
runnerPrices(i) = New BFUK.RunnerPrices
With runnerPrices(i) 'Assign the runner data
.selectionId = Field(0)
.sortOrder = Field(1)
.totalAmountMatched = Val(Field(2))
.lastPriceMatched = Val(Field(3))
.handicap = Val(Field(4))
.reductionFactor = Val(Field(5))
.vacant = (Field(6).ToLower = "true")
.farBSP = Val(Field(7))
.nearBSP = Val(Field(8))
.actualBSP = Val(Field(9))
.bestPricesToBack = Prices(Part(1))
.bestPricesToLay = Prices(Part(2))
End With
Next
End Sub
Private Function Prices(ByVal PriceString As String) As BFUK.Price()
Dim Field As String(), Price As BFUK.Price(), k, m As Integer
Field = PriceString.Split("~") 'Split price fields
m = UBound(Field) \ 4 - 1 'm = number of prices - 1
ReDim Price(m)
For i = 0 To m
Price(i) = New BFUK.Price
With Price(i)
.price = Val(Field(k + 0)) 'Assign price data
.amountAvailable = Val(Field(k + 1))
.betType = [Enum].Parse(GetType(BFUK.BetTypeEnum), Field(k + 2), True)
.depth = Field(k + 3)
k += 4
End With
Next
Return Price 'Return the array of prices
End Function
End Class
Private Sub bGetMPricesComp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bGetMPricesComp.Click
Print("*** MarketPricesCompressed ****")
Dim oMPCreq As New BFUK.GetMarketPricesCompressedReq
With oMPCreq
.header = oHeaderUK()
.marketId = [i]YourMarketIdOfInterest[/i] 'an active market ID
End With
StateCount += 1
BetFairUK.getMarketPricesCompressedAsync(oMPCreq, StateCount) 'Call the API
End Sub
Private Sub BetFairUK_getMarketPricesCompressedCompleted(ByVal sender As Object, ByVal e As BFUK.getMarketPricesCompressedCompletedEventArgs) Handles BetFairUK.getMarketPricesCompressedCompleted
Try
If Not e.Cancelled Then
With e.Result
CheckHeader(.header)
Print("ErrorCode = " & .errorCode.ToString)
If .errorCode = BFUK.GetMarketPricesErrorEnum.OK Then
Dim oMarketPrices As New UnpackMarketPricesCompressed(.marketPrices)
With oMarketPrices
Print(.marketId & " " & .marketStatus.ToString & " " & .runnerPrices.Length & " runners")
'Process returned market prices here.
For i = 0 To .runnerPrices.Length - 1
With .runnerPrices(i)
Print(.sortOrder & " " & .selectionId & " " & .totalAmountMatched & " " & .lastPriceMatched)
End With
Next
End With
End If
End With
End If
Catch ex As ApplicationException
Print(e.Error.Message)
End Try
End Sub
Comment