このメソッドは、LCStream オブジェクトの形式を設定し、必要に応じてストリームデータを変換します。このメソッドでは 2 つ目のストリームが必要ないため、Convert メソッドより効率的です。
LCStream
Call lcStream .setFormat (format)
パラメータ |
説明 |
---|---|
format |
Long。ストリームオブジェクトに設定する形式です。ストリームの形式のリストについては、この章の「ストリーム形式」を参照してください。データはこのストリーム形式に変換されます。 |
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
The length of the msg in ASCII is 36.
The length of the msg in Unicode is 72.