GetYearRange

Indicates the range of years that is valid for an application. GetYearRange returns the first and last years in the range of valid years.

Syntax

<HsvYears>.GetYearRange plStartYear, plEndYear

Argument

Description

plStartYear

Long. Returns the first year.

plEndYear

Long. Returns the last year.

Example

This example creates a function that indicates whether a year is valid for an application. The function takes the year, then compares the year to the years returned by GetYearRange. If the year is less than the first valid year or greater than the last valid year, the year is not valid for the application and the function returns FALSE. Otherwise, the function returns TRUE.

Private Function IsYearInRange(lYYYY As Long) As Boolean
Dim cYears As HsvYears, lStart As Long, lEnd As Long
Set cYears = m_cMetadata.Years
cYears.GetYearRange lStart, lEnd
If lYYYY < lStart Or lYYYY > lEnd Then
  IsYearInRange = False
Else
  IsYearInRange = True
End If
End Function