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/03020405.xhp | 89 ++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 helpcontent2/source/text/sbasic/shared/03020405.xhp (limited to 'helpcontent2/source/text/sbasic/shared/03020405.xhp') diff --git a/helpcontent2/source/text/sbasic/shared/03020405.xhp b/helpcontent2/source/text/sbasic/shared/03020405.xhp new file mode 100644 index 000000000..d19d30546 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020405.xhp @@ -0,0 +1,89 @@ + + + + + + + FileAttr Function + /text/sbasic/shared/03020405.xhp + + + + + + +
+ + FileAttr function + + + +FileAttr Function +Returns the access mode or the file access number of a file that was opened with the Open statement. The file access number is dependent on the operating system (OSH = Operating System Handle). +
+If you use a 32-Bit operating system, you cannot use the FileAttr-Function to determine the file access number. +See also: Open + + + +FileAttr (FileNumber As Integer, Attribute As Integer) + + + +Integer + + + FileNumber: The number of the file that was opened with the Open statement. + Attribute: Integer expression that indicates the type of file information that you want to return. The following values are possible: +1: The FileAttr-Function indicates the access mode of the file. +2: The FileAttr-Function returns the file access number of the operating system. +If you specify a parameter attribute with a value of 1, the following return values apply: +1 - INPUT (file open for input) +2 - OUTPUT (file open for output) +4 - RANDOM (file open for random access) +8 - APPEND (file open for appending) +32 - BINARY (file open in binary mode). + + + + + + +Sub ExampleFileAttr + Dim iNumber As Integer + Dim sLine As String + Dim aFile As String + aFile = "C:\Users\ThisUser\data.txt" + iNumber = Freefile + Open aFile For Output As #iNumber + Print #iNumber, "This is a line of text" + MsgBox FileAttr(#iNumber, 1), 0, "Access mode" + MsgBox FileAttr(#iNumber, 2), 0, "File attribute" + Close #iNumber +End Sub + + +
+ + + + +
+ +
\ No newline at end of file -- cgit v1.2.3