DatetimeListGetRange Method for LCStream

This method gets a range of values in an LCStream DatetimeList object.

The stream must be in the LCSTREAMFMT_DATETIME_LIST format.

Defined In

LCStream

Syntax

Call lcStream. DatetimeListGetRange (index, startDatetime, endDatetime)

Parameters

Parameter

Description

index

Long, in the range 1 to lcStream.Rangecount. Index position of the range in the datetimeList stream.

startDatetime

LCDatetime. Output. The starting datetime of the range.

endDatetime

LCDatetime. Output. The ending datetime of the range.

Usage Notes®

Datetime list streams can contain a mixture of single datetime values and datetime ranges (as shown in the example). This method scans the list starting with the first element, searching for date-time values and counting them. Once the count reaches index, the date-time value at that position is returned. If the list contains a mixture, this might not be the indexed value in the list.

Example

Option Public
Uselsx "*lsxlc" 
Sub Initialize
  Dim datelist As New LCStream (0, 0, LCSTREAMFMT_DATETIME_LIST)
  Dim start As New LCDatetime
  Dim finish As New LCDatetime
  datelist.Text = "12/25/50,7:00AM,12/31/99 12:59PM,1/1/2000 12:00AM," & _
  "5:00PM - 6:00PM,6:30AM,5/1/96 - 5/31/96"
  Call datelist.DatetimeListGetRange (1, start, finish)
  Print "The new 1st range is " & start.Text & " - " & finish.Text
End Sub

Example Output

The new 1st range is 05:00:00 PM - 06:00:00 PM.