DatetimeListInsertRange Method for LCStream

This method inserts a datetime range into a datetime list stream object.

The stream must be in the LCSTREAMFMT_DATETIME_LIST format.

Defined In

LCStream

Syntax

Call datetimeNew. DatetimeListInsertRange (index, startDatetime, endDatetime)

Parameters

Parameter

Description

index

Long, in the range 1 to lcStream.Rangecount + 1. The position at which to insert the value(s).

startDatetime

LCDatetime. The first datetime value for the range.

endDatetime

LCDatetime. The second datetime value for 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 range values and counting them. Once the count reaches index, the range value at that position is returned. If the list contains a mixture, this might not be the indexth 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
  start.Text = "8/6/1941"
  finish.Text = "7/1/1997"
  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.DatetimeListInsertRange (2, start, finish)
  Print "The new stream is " & datelist.Text
End Sub

Example Output

The new stream is 12/25/1950, 07:00:00 AM, 12/31/1999 12:59:00 PM, 01/01/2000 12:00:00 AM, 06:30:00 AM, 05:00:00 PM - 06:00:00 PM, 08/06/1941 - 07/01/1997, 05/01/1996 - 05/31/1996