LibreOffice 24.8 Bantuan
Mengeset informasi atribut untuk berkas yang ditentukan.
SetAttr PathName As String, Attributes As Integer
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.
Attributes: Bit pattern defining the attributes that you want to set or to clear:
| Dinamakan konstan | Nilai | Definisi | 
|---|---|---|
| ATTR_NORMAL | 0 | Berkas normal. | 
| ATTR_READONLY | 1 | Berkas hanya-baca. | 
| ATTR_HIDDEN | 2 | File tersembunyi | 
Anda dapat mengatur beberapa atribut dengan menggabungkan nilai masing-masing dengan logika ATAU pernyataan.
Sub ExampleSetGetAttr
 Pada Galat GoTo ErrorHandler ' Tentukan sasaran untuk menangani kesalahan
 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