Returns the member ID of the period that is at a given ordinal position within a frequency.
<HsvPeriods>.GetPeriodFromFrequency lFreq, lPeriodNumInFreq, plPeriod
The following example creates a function named GetOrdinalPerName that takes the ordinal position of a period and returns the period’s label. In this function, GetBaseFrequency returns the ID of the application’s default frequency. This ID is passed to GetPeriodFromFrequency along with the ordinal position. The member ID returned by GetPeriodFromFrequency is passed to IHsvTreeInfo.GetLabel, and the returned period label is set as GetOrdinalPerName’s return value.
Function GetOrdinalPerName(lPerPos As Long) As String
Dim cTreeInfo As IHsvTreeInfo, cPeriods As HsvPeriods
Dim lFreqID As Long, lPerID As Long, sPerName As String
Set cTreeInfo = m_cMetadata.Periods
Set cPeriods = m_cMetadata.Periods
cPeriods.GetBaseFrequency lFreqID
cPeriods.GetPeriodFromFrequency lFreqID, lPerPos, lPerID
cTreeInfo.GetLabel lPerID, sPerName
GetOrdinalPerName = sPerName
End Function