Click or drag to resize

FAttr2String Function

Display file attributes as a string.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.5
Syntax
 FUNCTION FAttr2String(
	dwAttributes AS DWORD
) AS STRING

Parameters

dwAttributes
Type: UInt32
One or more of the following constants, indicating the file attribute(s) to return (file attributes are returned by FAttrib()):

Constant Returns
FA_DIRECTORY D
FA_VOLUME V
FC_ARCHIVED A
FC_HIDDEN H
FC_NORMAL NULL_STRING
FC_READONLY R
FC_SYSTEM S

Return Value

Type: String
One or more of the characters indicated in the table above, depending upon what file attribute constants were specified in <dwAttributes>.
If multiple attributes are present, the characters are concatenated as a string.  You can use the string search function, At(), to determine if a particular property is set (see example below).
Remarks
Examples
This examples shows the return values from FAttr2String():
X#
1? FAttr2String(FC_HIDDEN)                    // H
2? FAttr2String(FC_HIDDEN + FC_SYSTEM)        // HS
This example uses FAttr2String() to find out if the file named ABC.DBF is a read-only file:
X#
1FFirst("abc.dbf", FC_NORMAL)
2IF At(FAttr2String(FAttrib()), "R") > 0
3    // Attribute string contains "R" so file is read-only
4ENDIF
See Also