Use of FlagsAttribute

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Randy

    Use of FlagsAttribute

    I can't seem to find a clear example on how to use the FlagsAttribute. In
    my example below shouldn't both message boxes show? Instead no messagebox
    displays. I know that .NET will auto-number enum's when omitted.

    <Flags()> Public Enum Permission
    Read
    Write
    Delete
    Rename
    Copy
    Move
    End Enum

    Private p As Permission
    p = Permission.Copy And Permission.Read

    If p = Permission.Copy Then
    MessageBox.Show ("Copy")
    End If

    If p = Permission.Copy And p = Permission.Read Then
    MessageBox.Show ("Copy & Read")
    End If


  • Daniel Pratt

    #2
    Re: Use of FlagsAttribute

    Hi Randy
    "Randy" <randy@penHATES PAMsoft.com> wrote in message
    news:OFCJzq0jDH A.392@TK2MSFTNG P11.phx.gbl...[color=blue]
    > I can't seem to find a clear example on how to use the FlagsAttribute. In
    > my example below shouldn't both message boxes show? Instead no messagebox
    > displays. I know that .NET will auto-number enum's when omitted.[/color]
    <snip>

    If you don't specify values for your enum fields, they will be assigned
    values in a straight sequence (1,2,3,4, etc...). If you want a "flagged"
    enum you need to specify values that correspond to individual bit positions
    (1,2,4,16, etc.):

    <Flags()> Public Enum Permission
    Read = 1
    Write = 2
    Delete = 4
    Rename = 16
    Copy = 32
    Move = 64
    End Enum

    Hope that helps.

    Regards,
    Dan

    p.s. *Should* the compiler be smart enough to auto-assign values correctly
    if the "Flags" attribute is present? I think so.


    Comment

    • Jay B. Harlow [MVP - Outlook]

      #3
      Re: Use of FlagsAttribute

      Randy,
      In addition to Daniel's suggestion of giving values to the Enum values.

      <Flags()> Public Enum Permission
      Read = 1
      Write = 2
      Delete = 4
      Rename = 16
      Copy = 32
      Move = 64
      End Enum

      To combine the values you need to use Or.
      [color=blue]
      > Private p As Permission[/color]
      p = Permission.Copy Or Permission.Read

      Then you need to 'mask' the value and see if its not zero.

      If (p and Permission.Copy ) <> 0 Then[color=blue]
      > MessageBox.Show ("Copy")
      > End If[/color]

      You can check for not zero or both values combined:
      If (p and Permission.Copy Or Permission.Read ) = (Permission.Cop y Or
      Permission.Read ) Then[color=blue]
      > MessageBox.Show ("Copy & Read")
      > End If[/color]

      Sometimes when dealing with combined values, such as Read & Copy above, I
      will define a constant that represents the two values combined

      Const ReadAndCopy As Permission = Permission.Copy Or Permission.Read
      If (p and ReadAndCopy ) = ReadAndCopy Then[color=blue]
      > MessageBox.Show ("Copy & Read")
      > End If[/color]

      Other times I will setup a function to check the masked values:

      Private Function CheckMask(ByVal value As Permission, ByVal mask As
      Permission)
      Return (value And mask) = value
      End Function

      If CheckMask(p, Permission.Copy Or Permission.Read ) Then[color=blue]
      > MessageBox.Show ("Copy & Read")
      > End If[/color]

      I will use the mask & value method when I want to check that out of Copy &
      Read only Copy is set.

      If (p and Permission.Copy Or Permission.Read ) = Permission.Copy Then
      MessageBox.Show ("Of Copy & Read, only Copy set")
      End If

      When you think about it, one would expect And would be used to combine the
      value (set theory). However enums are implemented as integers and boolean
      theory is how they are worked with...

      Hope this helps
      Jay

      "Randy" <randy@penHATES PAMsoft.com> wrote in message
      news:OFCJzq0jDH A.392@TK2MSFTNG P11.phx.gbl...[color=blue]
      > I can't seem to find a clear example on how to use the FlagsAttribute. In
      > my example below shouldn't both message boxes show? Instead no messagebox
      > displays. I know that .NET will auto-number enum's when omitted.
      >
      > <Flags()> Public Enum Permission
      > Read
      > Write
      > Delete
      > Rename
      > Copy
      > Move
      > End Enum
      >
      > Private p As Permission
      > p = Permission.Copy And Permission.Read
      >
      > If p = Permission.Copy Then
      > MessageBox.Show ("Copy")
      > End If
      >
      > If p = Permission.Copy And p = Permission.Read Then
      > MessageBox.Show ("Copy & Read")
      > End If
      >
      >[/color]


      Comment

      • Jay B. Harlow [MVP - Outlook]

        #4
        Re: Use of FlagsAttribute

        Randy,
        In addition to Daniel's suggestion of giving values to the Enum values.

        <Flags()> Public Enum Permission
        Read = 1
        Write = 2
        Delete = 4
        Rename = 16
        Copy = 32
        Move = 64
        End Enum

        To combine the values you need to use Or.
        [color=blue]
        > Private p As Permission[/color]
        p = Permission.Copy Or Permission.Read

        Then you need to 'mask' the value and see if its not zero.

        If (p and Permission.Copy ) <> 0 Then[color=blue]
        > MessageBox.Show ("Copy")
        > End If[/color]

        You can check for not zero or both values combined:
        If (p and Permission.Copy Or Permission.Read ) = (Permission.Cop y Or
        Permission.Read ) Then[color=blue]
        > MessageBox.Show ("Copy & Read")
        > End If[/color]

        Sometimes when dealing with combined values, such as Read & Copy above, I
        will define a constant that represents the two values combined

        Const ReadAndCopy As Permission = Permission.Copy Or Permission.Read
        If (p and ReadAndCopy ) = ReadAndCopy Then[color=blue]
        > MessageBox.Show ("Copy & Read")
        > End If[/color]

        Other times I will setup a function to check the masked values:

        Private Function CheckMask(ByVal value As Permission, ByVal mask As
        Permission)
        Return (value And mask) = value
        End Function

        If CheckMask(p, Permission.Copy Or Permission.Read ) Then[color=blue]
        > MessageBox.Show ("Copy & Read")
        > End If[/color]

        I will use the mask & value method when I want to check that out of Copy &
        Read only Copy is set.

        If (p and Permission.Copy Or Permission.Read ) = Permission.Copy Then
        MessageBox.Show ("Of Copy & Read, only Copy set")
        End If

        When you think about it, one would expect And would be used to combine the
        value (set theory). However enums are implemented as integers and boolean
        theory is how they are worked with...

        Hope this helps
        Jay

        "Randy" <randy@penHATES PAMsoft.com> wrote in message
        news:OFCJzq0jDH A.392@TK2MSFTNG P11.phx.gbl...[color=blue]
        > I can't seem to find a clear example on how to use the FlagsAttribute. In
        > my example below shouldn't both message boxes show? Instead no messagebox
        > displays. I know that .NET will auto-number enum's when omitted.
        >
        > <Flags()> Public Enum Permission
        > Read
        > Write
        > Delete
        > Rename
        > Copy
        > Move
        > End Enum
        >
        > Private p As Permission
        > p = Permission.Copy And Permission.Read
        >
        > If p = Permission.Copy Then
        > MessageBox.Show ("Copy")
        > End If
        >
        > If p = Permission.Copy And p = Permission.Read Then
        > MessageBox.Show ("Copy & Read")
        > End If
        >
        >[/color]


        Comment

        • Mr.Tickle

          #5
          Re: Use of FlagsAttribute

          This is something I find that .NET messed up.


          if I specify the [Flags] attribute, why should I have to set the enum values
          in powers of 2? Why cant the enum be smart enough to see that attribute and
          set them accordingly. What is the benifit of the Flags attribute then? Its
          lost. Pointless.





          "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@ema il.msn.com> wrote in message
          news:OyZU0V6jDH A.684@TK2MSFTNG P09.phx.gbl...[color=blue]
          > Randy,
          > In addition to Daniel's suggestion of giving values to the Enum values.
          >
          > <Flags()> Public Enum Permission
          > Read = 1
          > Write = 2
          > Delete = 4
          > Rename = 16
          > Copy = 32
          > Move = 64
          > End Enum
          >
          > To combine the values you need to use Or.
          >[color=green]
          > > Private p As Permission[/color]
          > p = Permission.Copy Or Permission.Read
          >
          > Then you need to 'mask' the value and see if its not zero.
          >
          > If (p and Permission.Copy ) <> 0 Then[color=green]
          > > MessageBox.Show ("Copy")
          > > End If[/color]
          >
          > You can check for not zero or both values combined:
          > If (p and Permission.Copy Or Permission.Read ) = (Permission.Cop y Or
          > Permission.Read ) Then[color=green]
          > > MessageBox.Show ("Copy & Read")
          > > End If[/color]
          >
          > Sometimes when dealing with combined values, such as Read & Copy above, I
          > will define a constant that represents the two values combined
          >
          > Const ReadAndCopy As Permission = Permission.Copy Or Permission.Read
          > If (p and ReadAndCopy ) = ReadAndCopy Then[color=green]
          > > MessageBox.Show ("Copy & Read")
          > > End If[/color]
          >
          > Other times I will setup a function to check the masked values:
          >
          > Private Function CheckMask(ByVal value As Permission, ByVal mask As
          > Permission)
          > Return (value And mask) = value
          > End Function
          >
          > If CheckMask(p, Permission.Copy Or Permission.Read ) Then[color=green]
          > > MessageBox.Show ("Copy & Read")
          > > End If[/color]
          >
          > I will use the mask & value method when I want to check that out of Copy &
          > Read only Copy is set.
          >
          > If (p and Permission.Copy Or Permission.Read ) = Permission.Copy Then
          > MessageBox.Show ("Of Copy & Read, only Copy set")
          > End If
          >
          > When you think about it, one would expect And would be used to combine the
          > value (set theory). However enums are implemented as integers and boolean
          > theory is how they are worked with...
          >
          > Hope this helps
          > Jay
          >
          > "Randy" <randy@penHATES PAMsoft.com> wrote in message
          > news:OFCJzq0jDH A.392@TK2MSFTNG P11.phx.gbl...[color=green]
          > > I can't seem to find a clear example on how to use the FlagsAttribute.[/color][/color]
          In[color=blue][color=green]
          > > my example below shouldn't both message boxes show? Instead no[/color][/color]
          messagebox[color=blue][color=green]
          > > displays. I know that .NET will auto-number enum's when omitted.
          > >
          > > <Flags()> Public Enum Permission
          > > Read
          > > Write
          > > Delete
          > > Rename
          > > Copy
          > > Move
          > > End Enum
          > >
          > > Private p As Permission
          > > p = Permission.Copy And Permission.Read
          > >
          > > If p = Permission.Copy Then
          > > MessageBox.Show ("Copy")
          > > End If
          > >
          > > If p = Permission.Copy And p = Permission.Read Then
          > > MessageBox.Show ("Copy & Read")
          > > End If
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • Mr.Tickle

            #6
            Re: Use of FlagsAttribute

            This is something I find that .NET messed up.


            if I specify the [Flags] attribute, why should I have to set the enum values
            in powers of 2? Why cant the enum be smart enough to see that attribute and
            set them accordingly. What is the benifit of the Flags attribute then? Its
            lost. Pointless.





            "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@ema il.msn.com> wrote in message
            news:OyZU0V6jDH A.684@TK2MSFTNG P09.phx.gbl...[color=blue]
            > Randy,
            > In addition to Daniel's suggestion of giving values to the Enum values.
            >
            > <Flags()> Public Enum Permission
            > Read = 1
            > Write = 2
            > Delete = 4
            > Rename = 16
            > Copy = 32
            > Move = 64
            > End Enum
            >
            > To combine the values you need to use Or.
            >[color=green]
            > > Private p As Permission[/color]
            > p = Permission.Copy Or Permission.Read
            >
            > Then you need to 'mask' the value and see if its not zero.
            >
            > If (p and Permission.Copy ) <> 0 Then[color=green]
            > > MessageBox.Show ("Copy")
            > > End If[/color]
            >
            > You can check for not zero or both values combined:
            > If (p and Permission.Copy Or Permission.Read ) = (Permission.Cop y Or
            > Permission.Read ) Then[color=green]
            > > MessageBox.Show ("Copy & Read")
            > > End If[/color]
            >
            > Sometimes when dealing with combined values, such as Read & Copy above, I
            > will define a constant that represents the two values combined
            >
            > Const ReadAndCopy As Permission = Permission.Copy Or Permission.Read
            > If (p and ReadAndCopy ) = ReadAndCopy Then[color=green]
            > > MessageBox.Show ("Copy & Read")
            > > End If[/color]
            >
            > Other times I will setup a function to check the masked values:
            >
            > Private Function CheckMask(ByVal value As Permission, ByVal mask As
            > Permission)
            > Return (value And mask) = value
            > End Function
            >
            > If CheckMask(p, Permission.Copy Or Permission.Read ) Then[color=green]
            > > MessageBox.Show ("Copy & Read")
            > > End If[/color]
            >
            > I will use the mask & value method when I want to check that out of Copy &
            > Read only Copy is set.
            >
            > If (p and Permission.Copy Or Permission.Read ) = Permission.Copy Then
            > MessageBox.Show ("Of Copy & Read, only Copy set")
            > End If
            >
            > When you think about it, one would expect And would be used to combine the
            > value (set theory). However enums are implemented as integers and boolean
            > theory is how they are worked with...
            >
            > Hope this helps
            > Jay
            >
            > "Randy" <randy@penHATES PAMsoft.com> wrote in message
            > news:OFCJzq0jDH A.392@TK2MSFTNG P11.phx.gbl...[color=green]
            > > I can't seem to find a clear example on how to use the FlagsAttribute.[/color][/color]
            In[color=blue][color=green]
            > > my example below shouldn't both message boxes show? Instead no[/color][/color]
            messagebox[color=blue][color=green]
            > > displays. I know that .NET will auto-number enum's when omitted.
            > >
            > > <Flags()> Public Enum Permission
            > > Read
            > > Write
            > > Delete
            > > Rename
            > > Copy
            > > Move
            > > End Enum
            > >
            > > Private p As Permission
            > > p = Permission.Copy And Permission.Read
            > >
            > > If p = Permission.Copy Then
            > > MessageBox.Show ("Copy")
            > > End If
            > >
            > > If p = Permission.Copy And p = Permission.Read Then
            > > MessageBox.Show ("Copy & Read")
            > > End If
            > >
            > >[/color]
            >
            >[/color]


            Comment

            • Jay B. Harlow [MVP - Outlook]

              #7
              Re: Use of FlagsAttribute

              Mr.Tickle,
              I won't disagree with you in that the compiler should figure out to use
              Powers of two when you apply the Flags attribute and do not explicitly list
              the values.
              [color=blue]
              > What is the benifit of the Flags attribute then?[/color]
              The attribute controls the default behavior of the Enum.ToString method.

              For example:

              Private p As Permission
              p = Permission.Copy Or Permission.Read

              Debug.WriteLine (p, "Permission ")

              If Permission has the Flags attribute, then "Permission : Copy, Read" will be
              printed, without the Flags attribute 33 will be printed. You can use one of
              the Overloaded Enum.ToString methods to control this...

              Hope this helps
              Jay

              "Mr.Tickle" <MrTickle@mrmen .com> wrote in message
              news:%23BVPI69j DHA.2528@TK2MSF TNGP12.phx.gbl. ..[color=blue]
              > This is something I find that .NET messed up.
              >
              >
              > if I specify the [Flags] attribute, why should I have to set the enum[/color]
              values[color=blue]
              > in powers of 2? Why cant the enum be smart enough to see that attribute[/color]
              and[color=blue]
              > set them accordingly. What is the benifit of the Flags attribute then?[/color]
              Its[color=blue]
              > lost. Pointless.
              >
              >
              >
              >
              >
              > "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@ema il.msn.com> wrote in[/color]
              message[color=blue]
              > news:OyZU0V6jDH A.684@TK2MSFTNG P09.phx.gbl...[color=green]
              > > Randy,
              > > In addition to Daniel's suggestion of giving values to the Enum values.
              > >
              > > <Flags()> Public Enum Permission
              > > Read = 1
              > > Write = 2
              > > Delete = 4
              > > Rename = 16
              > > Copy = 32
              > > Move = 64
              > > End Enum
              > >
              > > To combine the values you need to use Or.
              > >[color=darkred]
              > > > Private p As Permission[/color]
              > > p = Permission.Copy Or Permission.Read
              > >
              > > Then you need to 'mask' the value and see if its not zero.
              > >
              > > If (p and Permission.Copy ) <> 0 Then[color=darkred]
              > > > MessageBox.Show ("Copy")
              > > > End If[/color]
              > >
              > > You can check for not zero or both values combined:
              > > If (p and Permission.Copy Or Permission.Read ) = (Permission.Cop y Or
              > > Permission.Read ) Then[color=darkred]
              > > > MessageBox.Show ("Copy & Read")
              > > > End If[/color]
              > >
              > > Sometimes when dealing with combined values, such as Read & Copy above,[/color][/color]
              I[color=blue][color=green]
              > > will define a constant that represents the two values combined
              > >
              > > Const ReadAndCopy As Permission = Permission.Copy Or Permission.Read
              > > If (p and ReadAndCopy ) = ReadAndCopy Then[color=darkred]
              > > > MessageBox.Show ("Copy & Read")
              > > > End If[/color]
              > >
              > > Other times I will setup a function to check the masked values:
              > >
              > > Private Function CheckMask(ByVal value As Permission, ByVal mask As
              > > Permission)
              > > Return (value And mask) = value
              > > End Function
              > >
              > > If CheckMask(p, Permission.Copy Or Permission.Read ) Then[color=darkred]
              > > > MessageBox.Show ("Copy & Read")
              > > > End If[/color]
              > >
              > > I will use the mask & value method when I want to check that out of Copy[/color][/color]
              &[color=blue][color=green]
              > > Read only Copy is set.
              > >
              > > If (p and Permission.Copy Or Permission.Read ) = Permission.Copy[/color][/color]
              Then[color=blue][color=green]
              > > MessageBox.Show ("Of Copy & Read, only Copy set")
              > > End If
              > >
              > > When you think about it, one would expect And would be used to combine[/color][/color]
              the[color=blue][color=green]
              > > value (set theory). However enums are implemented as integers and[/color][/color]
              boolean[color=blue][color=green]
              > > theory is how they are worked with...
              > >
              > > Hope this helps
              > > Jay
              > >
              > > "Randy" <randy@penHATES PAMsoft.com> wrote in message
              > > news:OFCJzq0jDH A.392@TK2MSFTNG P11.phx.gbl...[color=darkred]
              > > > I can't seem to find a clear example on how to use the FlagsAttribute.[/color][/color]
              > In[color=green][color=darkred]
              > > > my example below shouldn't both message boxes show? Instead no[/color][/color]
              > messagebox[color=green][color=darkred]
              > > > displays. I know that .NET will auto-number enum's when omitted.
              > > >
              > > > <Flags()> Public Enum Permission
              > > > Read
              > > > Write
              > > > Delete
              > > > Rename
              > > > Copy
              > > > Move
              > > > End Enum
              > > >
              > > > Private p As Permission
              > > > p = Permission.Copy And Permission.Read
              > > >
              > > > If p = Permission.Copy Then
              > > > MessageBox.Show ("Copy")
              > > > End If
              > > >
              > > > If p = Permission.Copy And p = Permission.Read Then
              > > > MessageBox.Show ("Copy & Read")
              > > > End If
              > > >
              > > >[/color]
              > >
              > >[/color]
              >
              >[/color]


              Comment

              • Jay B. Harlow [MVP - Outlook]

                #8
                Re: Use of FlagsAttribute

                Mr.Tickle,
                I won't disagree with you in that the compiler should figure out to use
                Powers of two when you apply the Flags attribute and do not explicitly list
                the values.
                [color=blue]
                > What is the benifit of the Flags attribute then?[/color]
                The attribute controls the default behavior of the Enum.ToString method.

                For example:

                Private p As Permission
                p = Permission.Copy Or Permission.Read

                Debug.WriteLine (p, "Permission ")

                If Permission has the Flags attribute, then "Permission : Copy, Read" will be
                printed, without the Flags attribute 33 will be printed. You can use one of
                the Overloaded Enum.ToString methods to control this...

                Hope this helps
                Jay

                "Mr.Tickle" <MrTickle@mrmen .com> wrote in message
                news:%23BVPI69j DHA.2528@TK2MSF TNGP12.phx.gbl. ..[color=blue]
                > This is something I find that .NET messed up.
                >
                >
                > if I specify the [Flags] attribute, why should I have to set the enum[/color]
                values[color=blue]
                > in powers of 2? Why cant the enum be smart enough to see that attribute[/color]
                and[color=blue]
                > set them accordingly. What is the benifit of the Flags attribute then?[/color]
                Its[color=blue]
                > lost. Pointless.
                >
                >
                >
                >
                >
                > "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@ema il.msn.com> wrote in[/color]
                message[color=blue]
                > news:OyZU0V6jDH A.684@TK2MSFTNG P09.phx.gbl...[color=green]
                > > Randy,
                > > In addition to Daniel's suggestion of giving values to the Enum values.
                > >
                > > <Flags()> Public Enum Permission
                > > Read = 1
                > > Write = 2
                > > Delete = 4
                > > Rename = 16
                > > Copy = 32
                > > Move = 64
                > > End Enum
                > >
                > > To combine the values you need to use Or.
                > >[color=darkred]
                > > > Private p As Permission[/color]
                > > p = Permission.Copy Or Permission.Read
                > >
                > > Then you need to 'mask' the value and see if its not zero.
                > >
                > > If (p and Permission.Copy ) <> 0 Then[color=darkred]
                > > > MessageBox.Show ("Copy")
                > > > End If[/color]
                > >
                > > You can check for not zero or both values combined:
                > > If (p and Permission.Copy Or Permission.Read ) = (Permission.Cop y Or
                > > Permission.Read ) Then[color=darkred]
                > > > MessageBox.Show ("Copy & Read")
                > > > End If[/color]
                > >
                > > Sometimes when dealing with combined values, such as Read & Copy above,[/color][/color]
                I[color=blue][color=green]
                > > will define a constant that represents the two values combined
                > >
                > > Const ReadAndCopy As Permission = Permission.Copy Or Permission.Read
                > > If (p and ReadAndCopy ) = ReadAndCopy Then[color=darkred]
                > > > MessageBox.Show ("Copy & Read")
                > > > End If[/color]
                > >
                > > Other times I will setup a function to check the masked values:
                > >
                > > Private Function CheckMask(ByVal value As Permission, ByVal mask As
                > > Permission)
                > > Return (value And mask) = value
                > > End Function
                > >
                > > If CheckMask(p, Permission.Copy Or Permission.Read ) Then[color=darkred]
                > > > MessageBox.Show ("Copy & Read")
                > > > End If[/color]
                > >
                > > I will use the mask & value method when I want to check that out of Copy[/color][/color]
                &[color=blue][color=green]
                > > Read only Copy is set.
                > >
                > > If (p and Permission.Copy Or Permission.Read ) = Permission.Copy[/color][/color]
                Then[color=blue][color=green]
                > > MessageBox.Show ("Of Copy & Read, only Copy set")
                > > End If
                > >
                > > When you think about it, one would expect And would be used to combine[/color][/color]
                the[color=blue][color=green]
                > > value (set theory). However enums are implemented as integers and[/color][/color]
                boolean[color=blue][color=green]
                > > theory is how they are worked with...
                > >
                > > Hope this helps
                > > Jay
                > >
                > > "Randy" <randy@penHATES PAMsoft.com> wrote in message
                > > news:OFCJzq0jDH A.392@TK2MSFTNG P11.phx.gbl...[color=darkred]
                > > > I can't seem to find a clear example on how to use the FlagsAttribute.[/color][/color]
                > In[color=green][color=darkred]
                > > > my example below shouldn't both message boxes show? Instead no[/color][/color]
                > messagebox[color=green][color=darkred]
                > > > displays. I know that .NET will auto-number enum's when omitted.
                > > >
                > > > <Flags()> Public Enum Permission
                > > > Read
                > > > Write
                > > > Delete
                > > > Rename
                > > > Copy
                > > > Move
                > > > End Enum
                > > >
                > > > Private p As Permission
                > > > p = Permission.Copy And Permission.Read
                > > >
                > > > If p = Permission.Copy Then
                > > > MessageBox.Show ("Copy")
                > > > End If
                > > >
                > > > If p = Permission.Copy And p = Permission.Read Then
                > > > MessageBox.Show ("Copy & Read")
                > > > End If
                > > >
                > > >[/color]
                > >
                > >[/color]
                >
                >[/color]


                Comment

                Working...