Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Property Get
Message
 
À
25/04/1999 14:15:35
Information générale
Forum:
Visual Basic
Catégorie:
Contrôles ActiveX
Titre:
Divers
Thread ID:
00212046
Message ID:
00213227
Vues:
26
>I have got a confusion.
>Is it same if I use "Function" instead of "Property Get" in class module ? If it is not the same, can any body let me know the difference between.
>
>Thank you.

The difference is in the implementation (from what I understand). Using the property, you can use code like this:

myClass.myProperty = aValue

and to retrieve it, you just use:

myvar = myClass.myProperty

Consider instead, using functions for this. Setting would be:

myClass.SetMyProperty(aValue)

and to retrieve:

myvar = myClass.GetMyProperty

Now, Imagine doing this for 10, 20 or more properties!!! The Property Let Set and Get allow your end user (or in your end App) to use the property without knowing (needing) the function... not to mention, that this is the "more correct" way of doing this sort of stuff.

Hugo
"My get up and go must've got up and went"
-Steve Tyler, Aerosmith
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform