Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I am using the GetAttr constant, with the reference being "P:\", and i returns 48, when I would expect 16, because it is a directory. Wha does the 48 reference to? I know what the constants 0,1,2,4,8,16,32 mean. Is there a full listin somewhere? I have also recieved the constant 22 for my "C:\" Many Thanks in advance Justi -- turnerj ----------------------------------------------------------------------- turnerje's Profile: http://www.excelforum.com/member.php...fo&userid=2569 View this thread: http://www.excelforum.com/showthread.php?threadid=47306 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
48 is 16 + 32, so it means it has the attributes of directory and archive.
To check if your attribute is set, do something like GetAttr(filename) AND 16 A non-zero result means it is set. HTH Bob "turnerje" wrote in message ... I am using the GetAttr constant, with the reference being "P:\", and it returns 48, when I would expect 16, because it is a directory. What does the 48 reference to? I know what the constants 0,1,2,4,8,16,32 mean. Is there a full listing somewhere? I have also recieved the constant 22 for my "C:\" Many Thanks in advance Justin -- turnerje ------------------------------------------------------------------------ turnerje's Profile: http://www.excelforum.com/member.php...o&userid=25694 View this thread: http://www.excelforum.com/showthread...hreadid=473066 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
48 = 32 + 16 'directory + changed
22 = 16 + 4 + 2 'directory + system + hidden The list of attributes that you see in Help IS the "full listing". A file or directory can have move than one of the attributes: e.g. it can be read-only, hidden, system, and directory with the archive bit set. All of that information is returned on one value, which is a "bit map". To determine whether your filespec is a directory, your would use something like this If (GetAttr(FileSpec) And vbDirectory) Then which is directly analogous to the example in Help. From HELP(I have added caps for emphasis): "The value returned by GetAttr is the *SUM* of the following attribute values: Constant Value Description vbNormal 0 Normal. vbReadOnly 1 Read-only. vbHidden 2 Hidden. vbSystem 4 System file. vbDirectory 16 Directory or folder. vbArchive 32 File has changed since last backup. vbAlias 64 Specified file name is an alias. Available only on Mac ..... To *DETERMINE WHICH ATTRIBUTES ARE SET, USE THE AND OPERATOR* to perform a bitwise comparison of the value returned by the GetAttr function and the value of the individual file attribute you want. If the result is not zero, that attribute is set for the named file." On Tue, 4 Oct 2005 12:37:29 -0500, turnerje wrote: I am using the GetAttr constant, with the reference being "P:\", and it returns 48, when I would expect 16, because it is a directory. What does the 48 reference to? I know what the constants 0,1,2,4,8,16,32 mean. Is there a full listing somewhere? I have also recieved the constant 22 for my "C:\" Many Thanks in advance Justin |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula constants? | Excel Worksheet Functions | |||
Manifest Constants in VBA | Excel Discussion (Misc queries) | |||
Newbie question.. what does [somedata] represent? Constants?? | Excel Programming | |||
constants | Excel Discussion (Misc queries) | |||
constants | Excel Programming |