Click or drag to resize

FAttr2String Function

X#
Display file attributes as a string.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 FUNCTION FAttr2String(
	dwAttributes AS DWORD
) AS STRING
Request Example View Source

Parameters

dwAttributes
Type: DWord
One or more of the following constants, indicating the file attribute(s) to return (file attributes are returned by FAttrib()):
ConstantDescription
FA_DIRECTORY Directory
FA_VOLUME Vorume
FC_HIDDEN Hidden
FC_NORMAL Visible
FC_SYSTEM System

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