Ayuda de LibreOffice 7.2
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.
Si se omite la lista de expresiones, la instrucción Write añade una línea vacía al archivo.
Para añadir una lista de expresiones a un archivo nuevo o existente, éste debe estar abierto en modo Output o Append.
Las cadenas escritas se encierran entre comillas y se separan con comas. No necesitas poner estos delimitadores en la lista de expresones.
Cada instrucción Write genera un símbolo de fin de renglón como última entrada.
Numeros con delimitadores decimales son convertidos de acuerdo ala configuración del idioma o regionalización.
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