creo que mi pregunta es muy básica pero en serio no sé.
En un script de VBA tengo varios If que evalúan el valor de una propiedad de un objeto junto con otras constantes, algo así:
Const FILE_ALL_ACCESS = &h1f01ff
Const FOLDER_ADD_SUBDIRECTORY = &h000004
Const FILE_DELETE = &h010000
Const FILE_DELETE_CHILD = &h000040
Const FOLDER_TRAVERSE = &h000020
Const FILE_READ_ATTRIBUTES = &h000080
Const FILE_READ_CONTROL = &h020000
Const FOLDER_LIST_DIRECTORY = &h000001
Const FILE_READ_EA = &h000008
Const FILE_WRITE_ATTRIBUTES = &h000100
Const FILE_WRITE_DAC = &h040000
Const FOLDER_ADD_FILE = &h000002
Const FILE_WRITE_EA = &h000010
Const FILE_WRITE_OWNER = &h080000
If objACE.AccessMask And FOLDER_ADD_SUBDIRECTORY Then
'Algo
End If
If objACE.AccessMask And FILE_DELETE Then
'Algo
End If
If objACE.AccessMask And FILE_DELETE_CHILD Then
'Algo
End If
No evalúa que objACE.AccessMask y la constante tengan valor porque estas siempre tienen valor y no entra en todos los If. Por ejemplo, cuando objACE.AccessMask fue 1048580, entró en el If de la constante FOLDER_ADD_SUBDIRECTORY, cuando objACE.AccessMask fue 1048718, entró en los If de las constantes FOLDER_ADD_SUBDIRECTORY, FILE_READ_ATTRIBUTES, FILE_READ_EA y FOLDER_ADD_FILE, y así.
¿Cómo actúa ese AND en función de ambos valores?
Gracias de antemano, saludos