User Defined Types in VBA

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ธ.ค. 2024

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

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

    I have often thought that some developers turn to Classes too quickley when a simple UDT is all that was needed. Using a sledge hammer to drive a finishing nail if you will. Thanks Philipp!

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

    I've only ever used this to proceed in a more structured way, but it makes even more sense for parameter transfer. Super, got a great suggestion, thanks!

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

      Could not agree more. I thought UDT's were great but this method further extends their usefulness.

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

    UDT is like simplier Class in VBA, can be really convenient, if methods are not needed :)

  • @Mister.Economics
    @Mister.Economics 2 ปีที่แล้ว +1

    Phil - great video as always, many thanks. I have to ask - where did you get the cool Access T-shirt?

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

      Thank you, John! The T-shirt was a gift from Microsoft at the Access DevCon 2019 conference in Vienna, Austria. BTW: Registration for Access DevCon 2022 just opened last week. Take a look at the agenda if you like: www.donkarl.com/devcon/agenda.htm
      Due to Covid, it has to be a virtual conference this year.

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

    Interesting I didn't that it's posiible to create UDT in VBA like the ones in Go, C or C++ programming languages. I'll find a projecto to use it.

  • @عليعلي-ن1خ3ص
    @عليعلي-ن1خ3ص 2 ปีที่แล้ว

    Does the ThePerson UDT argument must be passed ByRef to the callee procedure as shown in your code ? if not, does it make any difference to pass the UDT argument ByVal vs ByRef ?

    • @AttackOnTyler
      @AttackOnTyler ปีที่แล้ว

      ByVal vs ByRef is always the same. ByVal will copy the value passed into the parameter. ByRef passes the memory reference to the parameter of the function.

  • @ПавелСараев-у1й
    @ПавелСараев-у1й 2 ปีที่แล้ว

    Never try to use UDT and Collections together)

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

      Can you even put a UDT into a collection?

    • @David-iq1kd
      @David-iq1kd 2 ปีที่แล้ว

      Why is that? And what about using them in an ArrayList??

  • @7Denial7
    @7Denial7 ปีที่แล้ว

    Why did you declare Person type as private If you want to pass a person parameter to the declared public function? This must throw a compiler error

    • @codekabinettcomen
      @codekabinettcomen  ปีที่แล้ว

      Did I? If I did it would indeed be an error. Luckily the compiler would catch it right away.