Henry Olive 5 Posted October 13 Good Day I want to make a **Folder** ReadOnly or Hidden and then change to Normal I tried below codes for ReadOnly and Normal but i got below err.msg var attributes: TFileAttributes; attributes := TFile.GetAttributes(CDS1FOLDERPATH.AsString); ReadOnly : Include(attributes, faReadOnly); // ERROR E2010 Incompatible types: 'TFileAttribute' and 'TFieldAttribute' TFile.SetAttributes(CDS1FOLDERPATH.AsString, attributes); Normal : Exclude(attributes, faReadOnly); TFile.SetAttributes(CDS1FOLDERPATH.AsString, attributes); Hidden : Share this post Link to post
Remy Lebeau 1392 Posted October 13 (edited) The Data.DB and System.IOUtils units both define an identifier named faReadOnly (as a member of TFieldAttribute and TFileAttribute, respectively). The error message means both units are in scope and the compiler doesn't know which one you want to use. So you will have to qualify it explicitly, eg: Include(attributes, TFileAttribute.faReadOnly); Exclude(attributes, TFileAttribute.faReadOnly); Edited October 13 by Remy Lebeau Share this post Link to post