Get Property also runs Set?!

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

    Get Property also runs Set?!

    While line by line debugging some code I noticed that whenever I run through
    Property Set it also subsequently calls Property Set with the having been
    Gotten data? Can anyone explain.
    A

  • Alan Gillott

    #2
    Re: Get Property also runs Set?!

    AAAAAARRRGGGHHH H! See correction below:
    "Alan Gillott" <argillott.x@gm ail.comwrote in message news:F350782E-8D5B-401A-83CD-FA1A46EA7121@mi crosoft.com...
    While line by line debugging some code I noticed that whenever I run through
    Property GET it also subsequently calls Property Set with the having been
    Gotten data? Can anyone explain.
    A
    >

    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Get Property also runs Set?!

      "Alan Gillott" <argillott.x@gm ail.comschrieb:
      While line by line debugging some code I noticed that whenever I run
      through Property Set it also subsequently calls Property Set with the
      having been Gotten data? Can anyone explain.
      Post your implementation of the property.

      Maybe you are recursively calling the 'Set' accessor of the property?

      \\\
      Public Property Foo() As Object
      Set(ByVal Value As Object)
      Me.Foo = Vaue
      End Set
      ...
      End Property
      ///

      This won't work. Use the code below instead:

      \\\
      Private m_Foo As Object

      Public Property Foo() As Object
      Set(ByVal Value As Object)
      m_Foo = Vaue
      End Set
      ...
      End Property
      ///

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

      Comment

      • kimiraikkonen

        #4
        Re: Get Property also runs Set?!

        On Mar 7, 11:42 pm, "Herfried K. Wagner [MVP]" <hirf-spam-me-
        h...@gmx.atwrot e:
        "Alan Gillott" <argillot...@gm ail.comschrieb:
        >
        While line by line debugging some code I noticed that whenever I run
        through Property Set it also subsequently calls Property Set with the
        having been Gotten data? Can anyone explain.
        >
        Post your implementation of the property.
        >
        Maybe you are recursively calling the 'Set' accessor of the property?
        >
        \\\
        Public Property Foo() As Object
            Set(ByVal Value As Object)
                Me.Foo = Vaue
            End Set
            ...
        End Property
        ///
        >
        This won't work.  Use the code below instead:
        >
        \\\
        Private m_Foo As Object
        >
        Public Property Foo() As Object
            Set(ByVal Value As Object)
                m_Foo = Vaue
            End Set
            ...
        End Property
        ///
        >
        --
         M S   Herfried K. Wagner
        M V P  <URL:http://dotnet.mvps.org/>
         V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
        Correction against mistype: Change "vaue"s to "value" in Herfried's
        post.

        Comment

        • Stephany Young

          #5
          Re: Get Property also runs Set?!

          If that's the most significant contribution you have to a thread then don't
          bother.

          It was painfully obvious to anyone with half a brain exactly what Herfried
          was demonstrating.


          "kimiraikko nen" <kimiraikkonen8 5@gmail.comwrot e in message
          news:d5f8b81c-9f6a-49ef-ab81-6399aca9fe0e@p2 5g2000hsf.googl egroups.com...
          On Mar 7, 11:42 pm, "Herfried K. Wagner [MVP]" <hirf-spam-me-
          h...@gmx.atwrot e:
          "Alan Gillott" <argillot...@gm ail.comschrieb:
          >
          While line by line debugging some code I noticed that whenever I run
          through Property Set it also subsequently calls Property Set with the
          having been Gotten data? Can anyone explain.
          >
          Post your implementation of the property.
          >
          Maybe you are recursively calling the 'Set' accessor of the property?
          >
          \\\
          Public Property Foo() As Object
          Set(ByVal Value As Object)
          Me.Foo = Vaue
          End Set
          ...
          End Property
          ///
          >
          This won't work. Use the code below instead:
          >
          \\\
          Private m_Foo As Object
          >
          Public Property Foo() As Object
          Set(ByVal Value As Object)
          m_Foo = Vaue
          End Set
          ...
          End Property
          ///
          >
          --
          M S Herfried K. Wagner
          M V P <URL:http://dotnet.mvps.org/>
          V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
          Correction against mistype: Change "vaue"s to "value" in Herfried's
          post.

          Comment

          • kimiraikkonen

            #6
            Re: Get Property also runs Set?!

            On Mar 8, 5:17 am, "Stephany Young" <noone@localhos twrote:
            If that's the most significant contribution you have to a thread then don't
            bother.
            >
            It was painfully obvious to anyone with half a brain exactly what Herfried
            was demonstrating.
            >
            "kimiraikko nen" <kimiraikkone.. .@gmail.comwrot e in message
            >
            news:d5f8b81c-9f6a-49ef-ab81-6399aca9fe0e@p2 5g2000hsf.googl egroups.com...
            On Mar 7, 11:42 pm, "Herfried K. Wagner [MVP]" <hirf-spam-me-
            >
            >
            >
            >
            >
            h...@gmx.atwrot e:
            "Alan Gillott" <argillot...@gm ail.comschrieb:
            >
            While line by line debugging some code I noticed that whenever I run
            through Property Set it also subsequently calls Property Set with the
            having been Gotten data? Can anyone explain.
            >
            Post your implementation of the property.
            >
            Maybe you are recursively calling the 'Set' accessor of the property?
            >
            \\\
            Public Property Foo() As Object
            Set(ByVal Value As Object)
            Me.Foo = Vaue
            End Set
            ...
            End Property
            ///
            >
            This won't work. Use the code below instead:
            >
            \\\
            Private m_Foo As Object
            >
            Public Property Foo() As Object
            Set(ByVal Value As Object)
            m_Foo = Vaue
            End Set
            ...
            End Property
            ///
            >
            --
            M S Herfried K. Wagner
            M V P <URL:http://dotnet.mvps.org/>
            V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
            >
            Correction against mistype: Change "vaue"s to "value" in Herfried's
            post.- Hide quoted text -
            >
            - Show quoted text -
            I just wanted to pay attention for OP not to get an annoying error.
            Saying this of you is completely nonsense and against goodwill that i
            just wanted to warned the OP with the purpose of being complementary,
            nothing more.

            Comment

            • Stephany Young

              #7
              Re: Get Property also runs Set?!

              That's just sanctimonious claptrap.

              As the OP is quite capable of single-stepping through his code, I am
              absolutely certain that he is quite capable of resolving a simple typo
              without someone attempting to save him from himself.

              Such posts do nothing more than clutter up threads, and the newsgroup in
              general, and add no value to the discussion at hand whatsoever.


              "kimiraikko nen" <kimiraikkonen8 5@gmail.comwrot e in message
              news:c018df96-0137-4d4f-a2e8-2a8c09265a4b@59 g2000hsb.google groups.com...
              On Mar 8, 5:17 am, "Stephany Young" <noone@localhos twrote:
              If that's the most significant contribution you have to a thread then
              don't
              bother.
              >
              It was painfully obvious to anyone with half a brain exactly what Herfried
              was demonstrating.
              >
              "kimiraikko nen" <kimiraikkone.. .@gmail.comwrot e in message
              >
              news:d5f8b81c-9f6a-49ef-ab81-6399aca9fe0e@p2 5g2000hsf.googl egroups.com...
              On Mar 7, 11:42 pm, "Herfried K. Wagner [MVP]" <hirf-spam-me-
              >
              >
              >
              >
              >
              h...@gmx.atwrot e:
              "Alan Gillott" <argillot...@gm ail.comschrieb:
              >
              While line by line debugging some code I noticed that whenever I run
              through Property Set it also subsequently calls Property Set with the
              having been Gotten data? Can anyone explain.
              >
              Post your implementation of the property.
              >
              Maybe you are recursively calling the 'Set' accessor of the property?
              >
              \\\
              Public Property Foo() As Object
              Set(ByVal Value As Object)
              Me.Foo = Vaue
              End Set
              ...
              End Property
              ///
              >
              This won't work. Use the code below instead:
              >
              \\\
              Private m_Foo As Object
              >
              Public Property Foo() As Object
              Set(ByVal Value As Object)
              m_Foo = Vaue
              End Set
              ...
              End Property
              ///
              >
              --
              M S Herfried K. Wagner
              M V P <URL:http://dotnet.mvps.org/>
              V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
              >
              Correction against mistype: Change "vaue"s to "value" in Herfried's
              post.- Hide quoted text -
              >
              - Show quoted text -
              I just wanted to pay attention for OP not to get an annoying error.
              Saying this of you is completely nonsense and against goodwill that i
              just wanted to warned the OP with the purpose of being complementary,
              nothing more.

              Comment

              • Galen Somerville

                #8
                Re: Get Property also runs Set?!


                "Stephany Young" <noone@localhos twrote in message
                news:Otr4rZQgIH A.1212@TK2MSFTN GP05.phx.gbl...
                That's just sanctimonious claptrap.
                >
                As the OP is quite capable of single-stepping through his code, I am
                absolutely certain that he is quite capable of resolving a simple typo
                without someone attempting to save him from himself.
                >
                Such posts do nothing more than clutter up threads, and the newsgroup in
                general, and add no value to the discussion at hand whatsoever.
                >
                >
                "kimiraikko nen" <kimiraikkonen8 5@gmail.comwrot e in message
                news:c018df96-0137-4d4f-a2e8-2a8c09265a4b@59 g2000hsb.google groups.com...
                On Mar 8, 5:17 am, "Stephany Young" <noone@localhos twrote:
                >If that's the most significant contribution you have to a thread then
                >don't
                >bother.
                >>
                >It was painfully obvious to anyone with half a brain exactly what
                >Herfried
                >was demonstrating.
                >>
                >"kimiraikkonen " <kimiraikkone.. .@gmail.comwrot e in message
                >>
                >news:d5f8b81 c-9f6a-49ef-ab81-6399aca9fe0e@p2 5g2000hsf.googl egroups.com...
                >On Mar 7, 11:42 pm, "Herfried K. Wagner [MVP]" <hirf-spam-me-
                >>
                >>
                >>
                >>
                >>
                >h...@gmx.atwro te:
                "Alan Gillott" <argillot...@gm ail.comschrieb:
                >>
                While line by line debugging some code I noticed that whenever I run
                through Property Set it also subsequently calls Property Set with the
                having been Gotten data? Can anyone explain.
                >>
                Post your implementation of the property.
                >>
                Maybe you are recursively calling the 'Set' accessor of the property?
                >>
                \\\
                Public Property Foo() As Object
                Set(ByVal Value As Object)
                Me.Foo = Vaue
                End Set
                ...
                End Property
                ///
                >>
                This won't work. Use the code below instead:
                >>
                \\\
                Private m_Foo As Object
                >>
                Public Property Foo() As Object
                Set(ByVal Value As Object)
                m_Foo = Vaue
                End Set
                ...
                End Property
                ///
                >>
                --
                M S Herfried K. Wagner
                M V P <URL:http://dotnet.mvps.org/>
                V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
                >>
                >Correction against mistype: Change "vaue"s to "value" in Herfried's
                >post.- Hide quoted text -
                >>
                >- Show quoted text -
                >
                I just wanted to pay attention for OP not to get an annoying error.
                Saying this of you is completely nonsense and against goodwill that i
                just wanted to warned the OP with the purpose of being complementary,
                nothing more.
                Sort of like top poster's?

                Galen



                Comment

                • Steve Gerrard

                  #9
                  Re: Get Property also runs Set?!

                  Stephany Young wrote:
                  That's just sanctimonious claptrap.
                  >
                  Such posts do nothing more than clutter up threads, and the newsgroup
                  in general, and add no value to the discussion at hand whatsoever.
                  >
                  And your post is somehow adding value? Talk about pots calling kettles black...


                  Comment

                  Working...