Collabora Office 21.06 ヘルプ
Writes data to a sequential text file with delimiting characters.
Write [#fileNum] {,|;} expression [, …]
fileNum: Any numeric expression that contains the file number that was set by the Open statement for the respective file.
expression list: Variables or expressions that you want to enter in a file, separated by commas.
式リストを省略すると、Write 文が空の行をファイルに追加します。
新規のファイルにせよ既存のファイルにせよ、データを書き込む場合は、該当ファイルを Output またはAppend モードでオープンしておく必要があります。
記述した文字列は引用符で囲まれ、コンマで区切られます。 式リストにこれらの区切り記号を入力する必要はありません。
各 Write ステートメントは、行と記号を最後の項目として出力します。
小数点のある数値は、ロケール設定に従って変換されます。
Sub ExampleWrite
Dim iCount As Integer
Dim sValue As String
iCount = Freefile
Open "C:\data.txt" For Output As iCount
sValue = "Hamburg"
Write #iCount,sValue,200
sValue = "New York"
Write #iCount,sValue,300
sValue = "Miami"
Write #iCount,sValue,450
Close #iCount
End Sub