SetAttr Instruction

Syntax

SetAttr Name$, Attrib

Group

File

Description

Set the attributes for file Name$. If the file does not exist then a run-time error occurs.

Sandbox

Sandbox mode blocks this instruction.

Parameters

Parameters Description
Name$ This string value is the path and name of the file. A path relative to the current directory can be used.
Attrib Set the file's attributes to this numeric value.

Example


Sub Main
    Attrib = GetAttr("XXX")
    SetAttr "XXX",1 ' readonly
    Debug.Print GetAttr("XXX") ' 1
    SetAttr "XXX",Attrib
End Sub