LibreOffice 7.3 Help
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.
Als de expressielijst wordt weggelaten, voegt de instructie Write een lege regel aan het bestand toe.
Om een expressielijst aan een nieuw of bestaand bestand toe te voegen, moet het bestand in de Output of Append modus worden geopend.
Tekenreeksen die u schrijft moeten zijn omsloten door aanhalingstekens en gescheiden door komma's. U hoeft deze scheidingstekens niet in te voeren in de expressielijst.
Elke instructie Write maakt een regeleinde-symbool als laatste item.
Getallen met decimale scheidingstekens worden overeenkomstig de lokale instellingen geconverteerd.
Sub ExampleWrite
Dim iCount As Integer
Dim sValue As String
iCount = Freefile
Open "C:\Users\ThisUser\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
Sub ExampleWrite
Dim iCount As Integer
Dim sValue As String
iCount = Freefile
Open "~/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