LCStream の Merge メソッド

このメソッドは、ストリームを別のストリームに結合し、新しいストリームを作成します。

定義位置

LCStream

構文

Call lcStream.Merge (stream1, offset, stream2)

パラメータ

パラメータ

説明

stream1

LCStream。stream2stream1 に結合されます。

offset

Long。lcStream での stream2 の先頭バイトの位置。stream2 は、stream1 の offset で指定された位置以降に挿入されます。

注: 文字数ではなく、バイト数を指定します。マルチバイトのキャラクタセット (特に Unicode) の場合は、これらの値は異なります。

stream2

LCStream。stream2stream1 にマージされます。stream2 の形式が stream1 と異なる場合は、stream1 の形式に変換してからマージされます。

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

出力例

The message, after inserting 'very ' starting at the 9th byte, is The very quick brown fox jumped over the lazy dog.