From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- .../source/text/sbasic/shared/03020205.xhp | 103 +++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 helpcontent2/source/text/sbasic/shared/03020205.xhp (limited to 'helpcontent2/source/text/sbasic/shared/03020205.xhp') diff --git a/helpcontent2/source/text/sbasic/shared/03020205.xhp b/helpcontent2/source/text/sbasic/shared/03020205.xhp new file mode 100644 index 000000000..f97195397 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020205.xhp @@ -0,0 +1,103 @@ + + + + + + + Write Statement + /text/sbasic/shared/03020205.xhp + + + + + +
+ + Write statement + + +

Write# Statement

+Writes data to a sequential text file with delimiting characters. +
+ +Use Print# statement to print data to a sequential text file. Use Put# statement to write data to a binary or a random file. + + + + Write Statement diagram + + +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. +If the expression list is omitted, the Write 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 Output or Append mode. +Strings that you write are enclosed by quotation marks and separated by commas. You do not need to enter these delimiters in the expression list. +Each Write statement outputs a line end symbol as last entry. +Numbers with decimal delimiters are converted according to the locale settings. + + + + + + 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 + + + + +
+ + + + +
+ +
\ No newline at end of file -- cgit v1.2.3