From 940b4d1848e8c70ab7642901a68594e8016caffc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 18:51:28 +0200 Subject: Adding upstream version 1:7.0.4. Signed-off-by: Daniel Baumann --- .../source/text/sbasic/shared/03020203.xhp | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 helpcontent2/source/text/sbasic/shared/03020203.xhp (limited to 'helpcontent2/source/text/sbasic/shared/03020203.xhp') diff --git a/helpcontent2/source/text/sbasic/shared/03020203.xhp b/helpcontent2/source/text/sbasic/shared/03020203.xhp new file mode 100644 index 000000000..2bb424393 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020203.xhp @@ -0,0 +1,78 @@ + + + + + + + Line Input # Statement + /text/sbasic/shared/03020203.xhp + + + + + + +
+ + Line Input statement + + + +Line Input # Statement +Reads strings from a sequential file into a variable. +
+ +Syntax: + +Line Input #FileNumber As Integer, Var As String + + +Parameters: + FileNumber: Number of the file that contains the data that you want to read. The file must have been opened in advance with the Open statement using the key word INPUT. + var: The name of the variable that stores the result. +With the Line Input# statement, you can read strings from an open file into a variable. String variables are read line-by-line up to the first carriage return (Asc=13) or linefeed (Asc=10). Line end marks are not included in the resulting string. + +Example: + +Sub ExampleWorkWithAFile +Dim iNumber As Integer +Dim sLine As String +Dim aFile As String +Dim sMsg As String + aFile = "c:\data.txt" + iNumber = Freefile + Open aFile For Output As #iNumber + Print #iNumber, "This is a line of text" + Print #iNumber, "This is another line of text" + Close #iNumber + iNumber = Freefile + Open aFile For Input As iNumber + While Not EOF(iNumber) + Line Input #iNumber, sLine + If sLine <>"" Then + sMsg = sMsg & sLine & chr(13) + End If + Wend + Close #iNumber + MsgBox sMsg +End Sub + + + +
\ No newline at end of file -- cgit v1.2.3