New Method for LCStream

This is the constructor method for the LCStream class. It creates an empty LCStream object and optionally assigns initial properties.

Defined In

LCStream

Syntax

Dim variableName As New LCStream(maxLength, flags, format)

Parameters

Parameter

Description

maxLength

Long. Optional. Maximum length that this stream's data can be. A value of zero indicates no maximum, which is not valid with the flag LCSTREAMF_FIXED. Default is 0.

streamFlags

Long. Optional. Flags for this stream. When using the flag LCSTREAMF_FIXED to create a fixed-length stream, the stream's data buffer is allocated to be maxLength bytes. Refer to the Stream Flags section for a description of the flags. The default is 0.

format

Long. Optional. Initial stream format to be assigned to the stream. The default is LCSTREAMFMT_UNICODE.

Example

Option Public
Uselsx "*lsxlc" 
Sub Initialize
	Dim times As New LCStream (0, 0, LCSTREAMFMT_DATETIME_LIST)
	Dim fixedMessage As New LCStream(30, LCSTREAMF_TRUNCATE, LCSTREAMFMT_NATIVE)
	Dim timeToday As New LCDateTime, timeTomorrow As LCDatetime
	Call timeToday.SetCurrent
	Set timeTomorrow = timeToday.Copy( )
	Call timeTomorrow.Adjust(LCDTUNIT_DAY, 1)
	Call times.DatetimeListInsertValue (1, timeToday)
	Call times.DatetimeListInsertValue (2, timeTomorrow)
	fixedMessage.Text = "begorrah! he cried, tapping on the backs of the sleeping tortoises."
		' We used the Truncate flag, so the code doesn't cause an overflow error.
	Print {Times = "} & times.Text & {", message = "} & fixedMessage.Text & {"}
End Sub

Example Output

Times = "03/13/2002 04:16:41.57 PM, 03/14/2002 04:16:41.57 PM", message = "begorrah! he cried, tapping on"