Navigation:  MCL Reference > Statistics on Past Records >

HrCount( ), JrCount( ), SrCount( )

Print this Topic Previous pageReturn to chapter overviewNext page

The functions return number of runs that meet the specified condition in the past records of the horse, jockey and stable respectively.

 

Syntax

HrCount('lCountIf',nRaces,'fCondition',nDefaultValue,cIncluding)

JrCount('lCountIf',nRaces,'fCondition',nDefaultValue,cIncluding)

SrCount('lCountIf',nRaces,'fCondition',nDefaultValue,cIncluding)

 

Argument

Description

Example

'lCountIf'

Datum the count of which is to be found.
lCountIf can be of any data type. If lCountIf is of logical type, all true (.T.) values will be counted. For any other types, record will be counted only if lCountIf returns a non-null value.

'HrFP( )=1'

nRaces

Number of latest races, counting back from the underlying race, to be averaged. The races must be meeting the condition specified by 'fCondition'.
If nRaces is omitted, all races meeting 'fCondition' will be included.
If total number of races meeting 'fCondition' is smaller than nRaces, the function will perform calculations on only the available races. You may use the HrCount( ) function to check how many races have been counted.

6

'fCondition'

If argument 'fCondition' is passed, the races (nRaces) will only be selected from those meeting 'fCondition'. The 'fCondition' argument is composed of a For clause and a While clause.
A For clause causes the function to act on each record that meets the specified logical condition.
A While clause causes the function to stop action once the logical expression evaluates to false.
Both For and While clauses are optional.

'For HrFP( )=1 While

HrDate( )>Date(1999,9,1)'

nDefaultValue

Default value returned when no race satisfying the specified condition can be found. The data type of this value must be identical to that of normal return value.


cIncluding

When applying the function to past records, by default, races in the underlying meeting are not included. You may use this argument to change the scope. See the following page for details: The cIncluding Argument.

'R'

 

Returns

Numeric

 

Examples

HrCount('HrRating( )>80',6,'For HrDistance( )=1400')

The above example counts in last six 1400m starts in which the bodyweight of the horse is greater than 1000. Since the first argument of the function is a logical expression, RaceMate will count the starts (which satisfy the condition in the 3rd argument) if the expression returns true.

 

HrCount('HrRating( )',6,'For HrDistance( )=1400')

The above example returns the number of 1400m starts, in which HrRating( ) returns a non-null value, in the past record of the horse. If total number of races is greater than 6, the function will return 6 instead of the actual number. Please note that starts will be counted even if HrRating( ) returns 0.

 

JrCount(,'While JrSeason( )='+Str(JrSeason( ),4))

The above example returns the number of horses that the jockey has ride in this season.

 

HrCount(,'For HrDistance( )=1400 and HrAveRating( )>100')

The above example returns the number of races meeting the following conditions in the past records.

1.1400m race
2.Average rating of the race is greater than 100

 

See also

HrCountNZ( ), JrCountNZ( ), SrCountNZ( )

 

 


Page url: http://www.racematenet.com/english/help/index.html?hrcount.htm