J
JB
Hi All,
I'm pulling my hair over this and could really do with a bit of help.
I'm using various different enums as bit fields and I'd like to create
a set of generic Functions or Subs to manipulate the bitfields.
For instance:
<Flags()> _
Enum ActionFlags As Byte
None = 0
Log = 1
Display = 2
End Enum
<Flags()> _
Enum TypeFlags As Byte
None = 0
eInfo = 1
eWarning = 2
eError = 4
End Enum
Public Sub SetFlag(ByRef iBitFieldValue As [Enum], ByVal iBitToSet As
[Enum])
iBitFieldValue = (iBitFieldValue Or iBitToSet)
End Sub
I've tried various different forms of this Sub but I can't seem to be
able to pass a "generic" Enum as a parameter that would work for both
ActionFlags and TypeFlags.
Any help would be greatly appreciated.
Thanks
JB
I'm pulling my hair over this and could really do with a bit of help.
I'm using various different enums as bit fields and I'd like to create
a set of generic Functions or Subs to manipulate the bitfields.
For instance:
<Flags()> _
Enum ActionFlags As Byte
None = 0
Log = 1
Display = 2
End Enum
<Flags()> _
Enum TypeFlags As Byte
None = 0
eInfo = 1
eWarning = 2
eError = 4
End Enum
Public Sub SetFlag(ByRef iBitFieldValue As [Enum], ByVal iBitToSet As
[Enum])
iBitFieldValue = (iBitFieldValue Or iBitToSet)
End Sub
I've tried various different forms of this Sub but I can't seem to be
able to pass a "generic" Enum as a parameter that would work for both
ActionFlags and TypeFlags.
Any help would be greatly appreciated.
Thanks
JB