GetAttr Function

Tagastab bitimustri, mis mÀÀrab draivi vĂ”i kataloogi failitĂŒĂŒbi vĂ”i failinime.

SĂŒntaks:


GetAttr (Text As String)

TagastusvÀÀrtus:

TĂ€isarv

Parameetrid:

Text: faili ĂŒhtseid tehnilisi andmeid sisaldav mis tahes stringavaldis. Soovi korral saab kasutada ka URL-i tĂ€histust.

See funktsioon mÀÀratleb mÀÀratud faili atribuudid ja tagastab bitimustri, mille abil saad mÀÀrata jÀrgmised failiatribuudid:

Error codes:

5 Vigane protseduuri vÀljakutse

53 Faili ei leitud

VÀÀrtus

Named constant

Value

Definition

ATTR_NORMAL

0

Normal files.

ATTR_READONLY

1

Read-only files.

ATTR_HIDDEN

2

Hidden file

ATTR_SYSTEM

4

System file

ATTR_VOLUME

8

Returns the name of the volume

ATTR_DIRECTORY

16

Returns the name of the directory only.

ATTR_ARCHIVE

32

File was changed since last backup (Archive bit).


Kui soovid teada, kas atribuudi baidi bitt on seatud, siis kasuta jÀrgmist pÀringumeetodit:

NĂ€ide:


Sub ExampleSetGetAttr
On Error Goto ErrorHandler REM MÀÀra veakÀsitleja sihtmÀrk
 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" ,1
 Print GetAttr( "c:\test\autoexec.sav" )
 End
ErrorHandler:
 Print Error
 End
End Sub

Palun toeta meid!