Moderator: 2020vision
by alrodopial » Fri Jan 24, 2014 8:07 pm
by davez » Sat Jan 25, 2014 5:44 am
by osknows » Sat Jan 25, 2014 12:17 pm
Option Explicit
Sub test()
Dim distance As String
Dim furlongs As Double
distance = "2m3f110y"
furlongs = StringToFurlongs(distance)
End Sub
Function StringToFurlongs(ByVal dist As String) As Double
Dim dcmiles As Long
Dim dcfurlongs As Long
Dim dcyards As Long
'miles
If InStr(1, dist, "m") > 0 Then
dcmiles = Left(dist, InStr(1, dist, "m") - 1)
Else
dcmiles = 0
End If
'furlongs
If InStr(1, dist, "f") > 0 Then
dcfurlongs = Mid(dist, InStr(1, dist, "m") + 1, InStr(1, dist, "f") - InStr(1, dist, "m") - 1)
Else
dcfurlongs = 0
End If
'yards (second test is for examples such as 1m100y where no furlongs in distance string)
If InStr(1, dist, "y") > 0 Then
If InStr(1, dist, "f") > 0 Then
dcyards = Mid(dist, InStr(1, dist, "f") + 1, InStr(1, dist, "y") - InStr(1, dist, "f") - 1)
Else
dcyards = Mid(dist, InStr(1, dist, "m") + 1, InStr(1, dist, "y") - InStr(1, dist, "m") - 1)
End If
Else
dcyards = 0
End If
StringToFurlongs = (dcmiles * 8) + dcfurlongs + (dcyards / 220)
End Function
by alrodopial » Sun Jan 26, 2014 12:40 pm
Public Function StringToFurlongs(ByVal dist As String) As Double
Dim dcmiles As Long
Dim dcfurlongs As Long
Dim dcyards As Long
'miles
If InStr(1, dist, "m") > 0 Then
dcmiles = Left(dist, InStr(1, dist, "m") - 1)
Else
dcmiles = 0
End If
'furlongs (second test is for examples such as 1f100y where no miles in distance string)
If InStr(1, dist, "f") > 0 Then
If InStr(1, dist, "m") > 0 Then
dcfurlongs = Mid(dist, InStr(1, dist, "m") + 1, InStr(1, dist, "f") - InStr(1, dist, "m") - 1)
Else
dcfurlongs = Left(dist, InStr(1, dist, "f") - 1)
End If
Else
dcfurlongs = 0
End If
'yards (second test is for examples such as 1m100y where no furlongs in distance string)
If InStr(1, dist, "y") > 0 Then
If InStr(1, dist, "f") > 0 Then
dcyards = Mid(dist, InStr(1, dist, "f") + 1, InStr(1, dist, "y") - InStr(1, dist, "f") - 1)
Else
dcyards = Mid(dist, InStr(1, dist, "m") + 1, InStr(1, dist, "y") - InStr(1, dist, "m") - 1)
End If
Else
dcyards = 0
End If
StringToFurlongs = (dcmiles * 8) + dcfurlongs + Round((dcyards / 220), 2)
End Function
by vanbuuts » Sat May 23, 2015 9:08 pm
by Captain Sensible » Mon May 25, 2015 2:11 pm
by dflowe » Sat Oct 24, 2020 4:21 pm
by Captain Sensible » Sat Oct 24, 2020 4:51 pm
by dflowe » Sat Oct 24, 2020 5:37 pm
by Captain Sensible » Sat Oct 24, 2020 5:40 pm
by Captain Sensible » Sat Oct 24, 2020 5:44 pm
=StringToFurlongs(A1)
Public Function StringToFurlongs(ByVal dist As String) As Double
If InStr(1, dist, ":") > 0 Then
Dim marketArray() As String
marketArray = Split(dist, ":")
dist = Split(marketArray(1), " ")(1)
Else
StringToFurlongs = 0
Exit Function
End If
Dim dcmiles As Long
Dim dcfurlongs As Long
Dim dcyards As Long
'miles
If InStr(1, dist, "m") > 0 Then
dcmiles = Left(dist, InStr(1, dist, "m") - 1)
Else
dcmiles = 0
End If
If InStr(1, dist, "f") > 0 Then
If InStr(1, dist, "m") > 0 Then
dcfurlongs = Mid(dist, InStr(1, dist, "m") + 1, InStr(1, dist, "f") - InStr(1, dist, "m") - 1)
Else
dcfurlongs = Left(dist, InStr(1, dist, "f") - 1)
End If
Else
dcfurlongs = 0
End If
StringToFurlongs = (dcmiles * 8) + dcfurlongs
End Function
The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.
Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.
Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.
He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.
We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.