Merge Method for LCStream
This method combines one stream into another, producing a new stream.
Defined In
LCStream
Syntax
Call lcStream.Merge (stream1, offset, stream2)
Parameters
Parameter |
Description |
---|---|
stream1 |
LCStream. stream2 is combined into stream1. |
offset |
Long. Position in lcStream of the first byte of stream2 - stream2 is inserted into stream1 starting at the position indicated by offset. Note: This is the number of bytes, not the number of characters. For multibyte character sets (Unicode in particular), the values will differ.
|
stream2 |
LCStream. stream2 is merged into stream1. If stream2 is a different format than stream1, it is converted to the format of stream1 before being merged. |
Example
Option Public
Uselsx "*lsxlc"
Sub Initialize
Dim msg As New LCStream ' Unicode is the default format for streams
Dim part As New LCStream
Dim newmsg As New LCStream
msg.Text = "The quick brown fox jumped over the lazy dog."
part.Text = "very "
REM counting start with 1 and each character in a Unicode string is 2 bytes
Call newmsg.Merge (msg, 9, part)
Print "The message, after inserting '" & part.Text"' starting at the 9th byte, is " & newmsg.Text
End Sub
Example Output
The message, after inserting 'very ' starting at the 9th byte, is The very quick brown fox jumped over the lazy dog.