Write Statement
Writes data to a sequential file.
Syntax:
Write [#]FileName, [Expressionlist]
Parameters:
\<emph\>FileName:\</emph\> Any numeric expression that contains the file number that was set by the Open statement for the respective file.
\<emph\>Expressionlist:\</emph\> Variables or expressions that you want to enter in a file, separated by commas.
If the expression list is omitted, the \<emph\>Write#\</emph\> statement appends an empty line to the file.
To add an expression list to a new or an existing file, the file must be opened in the \<emph\>Output\</emph\> or \<emph\>Append\</emph\> mode.
The \<emph\>Write#\</emph\> statement enters data that is enclosed by quotation marks and separated by commas into a file. You do not need to use delimiters in the list. The end of a file created with the \<emph\>Write#\</emph\> statement is indicated by a line end symbol.
Each Write statement outputs a line end symbol as last entry.
Numbers with decimal delimiters are converted according to the locale settings.
Example:
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