Getters and Setters in VBA

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ก.ย. 2024
  • In this video, we look at how getters and setters work in VBA.
    In order to understand how getters and setters work, we'll step through the ones we added to the cat class we created in my "Creating Classes in VBA" video ( • Creating Classes in VBA ).
    _____________________________________________________________________________________
    If you appreciate my content, please support this channel by donating on my website: sayrhymes.com/...
    #JenniferGarthVBA #vbatutorial

ความคิดเห็น • 6

  • @weibinren92
    @weibinren92 2 ปีที่แล้ว +1

    Hi, at 8:56, the content of the rngCatName Setter shouldn't be "Set prngCatName = rngCatNameArg"?
    And the content of the Getter should be "Set rngCatName = prngCatName"

    • @Jennifer_Garth
      @Jennifer_Garth  2 ปีที่แล้ว +4

      Yes, you are correct! Thank you for pointing this out. At 9:51, the code is corrected, which is why it worked when I ran the code.
      When I was editing the video, I must not have noticed that that code is wrong and then corrected with no explanation.
      I will see if there is any way for me to edit the video on TH-cam to add a note about the error. I will also create a new video discussing this issue and use it as an opportunity to discuss getters and setters a little more and talk a little bit about debugging. But for now, I'll just pin your comment.

  • @jmathew6988
    @jmathew6988 2 ปีที่แล้ว +2

    This is gold. Thank you!

  • @Maxseven777
    @Maxseven777 ปีที่แล้ว +4

    I think the three properties should be changed by Microsoft to Get, SetObj, SetVal, instead of Get, Set and Let. I find the "Let" term to be confusing. Just saying 😁

  • @philhamilton6926
    @philhamilton6926 2 ปีที่แล้ว

    Good clear explanation. Thank you.

  • @fahadshaheen2373
    @fahadshaheen2373 9 หลายเดือนก่อน

    sorry Jennifer , but the explanation is really confusing especially with this unnoticed mistake you have made .