Navigation:  MCL Reference > Data Collection Assistant Functions >

StartVar( )

Print this Topic Previous pageReturn to chapter overviewNext page

This function evaluates an MCL expression and stores the result into a variable, namely Start Variable. When the function StartVart(cVariableName, "eMCLExpr") is executed in a horse row of a race in a view, the system will check if the variable is already defined for the horse in the race. If the variable has already been defined for this start, the function will return the value stored in the variable. Otherwise it will evaluate the MCL expression eMCLExpr and store the result into the variable (the variable will automatically be created) and return the result. Please note the following points about race variables:

1.The value of a starter variable for a horse is independent of the same variable for another horse of the current or another race. The expression eMCLExpr will be evaluated for each horse of each race.
2.When you expend a view to show the past records, although the lines are not showing the data of the current race, the starter variable will not be recalculated.
3.Whenever the formula for a view column contains a StartVar( ) function, the system will automatically set the column type as "No Caching" (figure below) so that values in the view data cache (particularly those put into the past records of an expanded a view) will be refreshed automatically in other races.



4.The values of race variables are store in a variable cache that will not be refreshed when you push the "Recalc" key. To refresh the variable cache, you have to hold down the Shift key when you click on the "Recalc" key.
5.Start Variables (saved and accessed via RaceVar( )) and Race Variables (saved and accessed via StartVar( )) are store in different area of the variable cache. They will not interference with each other even the same variable name is given to both a Race Variable and a Start Variable.






Retruns Data type returned by the expression eMCLExpr



StartVar('AvgTime',"HrAverage('HrSeconds( )', ,Same('HrDistance( )'))")

When the function is firstly called in a horse row of a view, it stores the average time, in seconds, of the horse into the race variable AvgTime. Subsequent calls to the function for the same horse will return the value directly from the variable AvgTime.

The example view in the figure below shows the 221st race of season 2001-2002. The structure of the view is as follows:





(Built-in column:Horse Name)



(Built-in column:Final Odds)


Avg Odds

HrAverage('HrFinalOdds( )')


Diff (Avg Odds)

Column('Odds')-Column('Avg Odds')


Cur Avg Odds

StartVar('AvgOdds',"HrAverage('HrFinalOdds( )')")


Diff (Cur Avg Odds)

Column('Odds')-Column('Cur Avg Odds')



In this example view, the function of the "Cur Avg Odds" column stores the average odds up to the current race into the Start Variable "AvgOdds", in the past record lines of the view, the same function retrieves the value directly from the variable.


See Also

RaceVar( )



Page url: