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/03020414.xhp | 122 +++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 helpcontent2/source/text/sbasic/shared/03020414.xhp (limited to 'helpcontent2/source/text/sbasic/shared/03020414.xhp') diff --git a/helpcontent2/source/text/sbasic/shared/03020414.xhp b/helpcontent2/source/text/sbasic/shared/03020414.xhp new file mode 100644 index 000000000..e4cd4814d --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03020414.xhp @@ -0,0 +1,122 @@ + + + + + + + SetAttr Statement + /text/sbasic/shared/03020414.xhp + + + + + + +
+ + SetAttr statement + + + +SetAttr Statement +Sets the attribute information for a specified file. +
+ +Syntax: + +SetAttr FileName As String, Attribute As Integer + + +Parameters: +FileName: Name of the file, including the path, that you want to test attributes of. If you do not enter a path, SetAttr searches for the file in the current directory. You can also use URL notation. + Attribute: Bit pattern defining the attributes that you want to set or to clear: + Value + + + + + Named constant + + + Value + + + Definition + + + + + ATTR_NORMAL + + + 0 + + + Normal files. + + + + + ATTR_READONLY + + + 1 + + + Read-only files. + + + + + ATTR_HIDDEN + + + 2 + + + Hidden file + + +
+ +You can set multiple attributes by combining the respective values with a logic OR statement. + + + + + +Example: + +Sub ExampleSetGetAttr + On Error GoTo ErrorHandler ' Define target for error handler + If Dir("C:\test",16)="" Then MkDir "C:\test" + If Dir("C:\test\autoexec.sav")="" Then FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav" + SetAttr "c:\test\autoexec.sav" ,0 + FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav" + SetAttr "c:\test\autoexec.sav" , ATTR_READONLY + Print GetAttr( "c:\test\autoexec.sav" ) + End +ErrorHandler: + Print Error + End +End Sub + + + +
\ No newline at end of file -- cgit v1.2.3