num-var = FMGet_FileAttributes(FNum)


Operands:

FNum


The specific line number (of the FM display) to be evaluated.


Returns:

DWORD

Returns the current file attributes for the specified file. This a DWORD field of flag bits as defined by the Windows File System


Windows defines almost 20 various flags, but the ones you would normally care about are defined by these equates:

FM_EQU_READONLY            = &H00000001 

FM_EQU_HIDDEN              = &H00000002 

FM_EQU_SYSTEM              = &H00000004 

FM_EQU_DIRECTORY           = &H00000010 

FM_EQU_ARCHIVE             = &H00000020 


You will notice there is no flag for a 'normal' file.  Basically, if a file is not a directory, it is a 'normal' file.


Special Notes:


When testing, remember that multiple flags may be present at the same time, so do not simply perform a simple comparison of the returned value with one of the equates.


Example:

   if FMGet_FileAttributes(3) <> FM_EQU_DIRECTORY then

will NOT test properly for a 'normal' file.  If it were for example a System folder, it's value would be &H00000014, which is not equal to &H00000010, but it is certainly not a normal file.


The test should be: 

   if (FMGet_FileAttributes(3) AND FM_EQU_DIRECTORY) _

       <> FM_EQU_DIRECTORY then

The AND operation eliminates all other bits than the Directory bit so that the test is performed on only that flag.


Created with the Personal Edition of HelpNDoc: Eliminate the Struggles of Documentation with a Help Authoring Tool