SetFormat Method for LCStream
This method sets the format for an LCStream object, converting the stream data if necessary. This method may be more efficient than the Convert method, since a second stream is not required.
Defined In
LCStream
Syntax
Call lcStream .setFormat (format)
Parameters
Parameter |
Description |
---|---|
format |
Long. The format to which to set the stream object. See the list of stream formats in the section entitled "Stream Formats" earlier in this chapter. The data will be converted to this stream format. |
Example
Option Public
Uselsx "*lsxlc"
Sub Initialize
Dim msg As New LCStream (0, 0, LCSTREAMFMT_ASCII)
msg.Text = "Peter Pan lived in Never Never Land."
Print "The length of the msg in ASCII is " & msg.Length
Call msg.SetFormat (LCSTREAMFMT_UNICODE)
Print "The length of the msg in Unicode is " & msg.Length
End Sub
Example Output
The length of the msg in ASCII is 36.
The length of the msg in Unicode is 72.